Hallo,
Ik heb een programma geschreven in VB in excel en moet telkens bij een knop een .txt document openen.
Maar dit wordt rechtstreeks verwezen naar mijn C-Schijf.
->
dim File as string
File = "C:\Project\dirusage\dirusage_" & datum & "\data_size.txt"
'Toevoegen textdocument
With ActiveSheet.QueryTables.Add(Connection:= _
"TEXT;" & file & "", Destination:= _
Range("A1"))
.Name = "data_size"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.TextFilePromptOnRefresh = False
.TextFilePlatform = 1252
.TextFileStartRow = 1
.TextFileParseType = xlDelimited
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = True
.TextFileTabDelimiter = True
.TextFileSemicolonDelimiter = False
.TextFileCommaDelimiter = False
.TextFileSpaceDelimiter = True
.TextFileColumnDataTypes = Array(1, 1, 1, 1, 1)
.TextFileTrailingMinusNumbers = True
.Refresh BackgroundQuery:=False
End With
Het exceldocument zit in de zelfde map als het .txt bestand.
Wat ik zou willen bekomen is dat als heel de map naar bv de D-Schijf wordt gekopieerd, dat hij dit automatisch aanpast.
Ik hoop dat mijn vraag duidelijk is, anders vraag je maar
MVG
Domfree
Ik heb een programma geschreven in VB in excel en moet telkens bij een knop een .txt document openen.
Maar dit wordt rechtstreeks verwezen naar mijn C-Schijf.
->
dim File as string
File = "C:\Project\dirusage\dirusage_" & datum & "\data_size.txt"
'Toevoegen textdocument
With ActiveSheet.QueryTables.Add(Connection:= _
"TEXT;" & file & "", Destination:= _
Range("A1"))
.Name = "data_size"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.TextFilePromptOnRefresh = False
.TextFilePlatform = 1252
.TextFileStartRow = 1
.TextFileParseType = xlDelimited
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = True
.TextFileTabDelimiter = True
.TextFileSemicolonDelimiter = False
.TextFileCommaDelimiter = False
.TextFileSpaceDelimiter = True
.TextFileColumnDataTypes = Array(1, 1, 1, 1, 1)
.TextFileTrailingMinusNumbers = True
.Refresh BackgroundQuery:=False
End With
Het exceldocument zit in de zelfde map als het .txt bestand.
Wat ik zou willen bekomen is dat als heel de map naar bv de D-Schijf wordt gekopieerd, dat hij dit automatisch aanpast.
Ik hoop dat mijn vraag duidelijk is, anders vraag je maar
MVG
Domfree
Laatst bewerkt: