Excel macro in ED
Posted: Thursday 18 December, 2014 - 11:34
Hello,
I have to create an excel starting from different .csv files, where each .csv is required to be in a different sheet of the excel workbook. I tried to record the macro in excel (it's a connection between the file that I would like to do), but I can't find the right syntax in ED.
This is the code recorded from excel:
I have to do it starting from ED because all files (.xlsx and .csv) are destroyed and created again at each simulation, as well as I can't do a macro saved in "personal" excel because there are many users, and it would be necessary to install the macro in each pc.
what can I do?
Thanks
Chiara
I have to create an excel starting from different .csv files, where each .csv is required to be in a different sheet of the excel workbook. I tried to record the macro in excel (it's a connection between the file that I would like to do), but I can't find the right syntax in ED.
This is the code recorded from excel:
Code: Select all
Sheets.Add After:=ActiveSheet
With ActiveSheet.QueryTables.Add(Connection:= _
"TEXT;C:\Users\Chiara\Documents\Enterprise Dynamics 9\WMS.csv" _
, Destination:=Range("$A$1"))
.CommandType = 0
.Name = "WMS"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.TextFilePromptOnRefresh = False
.TextFilePlatform = 850
.TextFileStartRow = 1
.TextFileParseType = xlDelimited
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = False
.TextFileTabDelimiter = False
.TextFileSemicolonDelimiter = True
.TextFileCommaDelimiter = False
.TextFileSpaceDelimiter = False
.TextFileColumnDataTypes = Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1)
.TextFileTrailingMinusNumbers = True
.Refresh BackgroundQuery:=False
End With
what can I do?
Thanks
Chiara