G
Guest
Hi everybody,
I need to import a csv file and I work fine with this recorded macro:
Range("a1:j220").Select
Selection.ClearContents
Range("A1").Select
With ActiveSheet.QueryTables.Add(Connection:= _
"text;f:\maurizio\web\biliardo\script\eccel.csv",
Destination:=Range("A4"))
.Name = "eccel"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = False
.RefreshPeriod = 0
.TextFilePromptOnRefresh = False
.TextFilePlatform = 1252
.TextFileStartRow = 1
.TextFileParseType = xlDelimited
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = False
.TextFileTabDelimiter = True
.TextFileSemicolonDelimiter = False
.TextFileCommaDelimiter = True
.TextFileSpaceDelimiter = False
.TextFileColumnDataTypes = Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 2)
.TextFileTrailingMinusNumbers = True
.refresh BackgroundQuery:=True
End With
My problem is how to avoid to specify the full path of the csv file as the
application
is to be used by other users and the path might not be the same.
Yes I know, everyone could match the path with its own machine
but I was wondering if a smarter way to do it exists.
Of course the csv file must be in the same application folder.
thanks
I need to import a csv file and I work fine with this recorded macro:
Range("a1:j220").Select
Selection.ClearContents
Range("A1").Select
With ActiveSheet.QueryTables.Add(Connection:= _
"text;f:\maurizio\web\biliardo\script\eccel.csv",
Destination:=Range("A4"))
.Name = "eccel"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = False
.RefreshPeriod = 0
.TextFilePromptOnRefresh = False
.TextFilePlatform = 1252
.TextFileStartRow = 1
.TextFileParseType = xlDelimited
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = False
.TextFileTabDelimiter = True
.TextFileSemicolonDelimiter = False
.TextFileCommaDelimiter = True
.TextFileSpaceDelimiter = False
.TextFileColumnDataTypes = Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 2)
.TextFileTrailingMinusNumbers = True
.refresh BackgroundQuery:=True
End With
My problem is how to avoid to specify the full path of the csv file as the
application
is to be used by other users and the path might not be the same.
Yes I know, everyone could match the path with its own machine
but I was wondering if a smarter way to do it exists.
Of course the csv file must be in the same application folder.
thanks