- Joined
- Oct 18, 2005
- Messages
- 1
- Reaction score
- 0
I have read some threads on this newsgroup, and have found that the questions here are usually the other way around, but I hope you can help me nonetheless...
I have a third party program that can export to Excel, however, it isn't very fast, so I created a .csv file instead, and (automatically) use some macro's in Excel to import it, and after that create a pivot-table with the data.
This works perfectly fine under excel 2003, however, I have a customer who has excel 2000, and I get errors on this code:
With ActiveSheet.QueryTables.Add(Connection:= _
sFileName, Destination:=Range("A1"))
.Name = "tmpexcel"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.TextFilePromptOnRefresh = False
' .TextFilePlatform = 437
.TextFileStartRow = 1
.TextFileParseType = xlDelimited
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = False
.TextFileTabDelimiter = True
.TextFileSemicolonDelimiter = False
.TextFileCommaDelimiter = False
.TextFileSpaceDelimiter = False
.TextFileColumnDataTypes = aFormat
' .TextFileTrailingMinusNumbers = True
.Refresh BackgroundQuery:=False
End With
Specifically on the two commented out statements.
Once I comment them out, this is the next statement that crahes excel:
ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatabase, SourceData:= _
sRange).CreatePivotTable TableDestination:="", TableName:= _
"Draaitabel1", DefaultVersion:=xlPivotTableVersion10
Specifically on the TableDestination:="", statement.
It would seem obvious that there are some differences in VBA for excel 2000 and VBA for excel 2003. Can anyone help me here?
Thank you in advance!
RichardC_NL
I have a third party program that can export to Excel, however, it isn't very fast, so I created a .csv file instead, and (automatically) use some macro's in Excel to import it, and after that create a pivot-table with the data.
This works perfectly fine under excel 2003, however, I have a customer who has excel 2000, and I get errors on this code:
With ActiveSheet.QueryTables.Add(Connection:= _
sFileName, Destination:=Range("A1"))
.Name = "tmpexcel"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.TextFilePromptOnRefresh = False
' .TextFilePlatform = 437
.TextFileStartRow = 1
.TextFileParseType = xlDelimited
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = False
.TextFileTabDelimiter = True
.TextFileSemicolonDelimiter = False
.TextFileCommaDelimiter = False
.TextFileSpaceDelimiter = False
.TextFileColumnDataTypes = aFormat
' .TextFileTrailingMinusNumbers = True
.Refresh BackgroundQuery:=False
End With
Specifically on the two commented out statements.
Once I comment them out, this is the next statement that crahes excel:
ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatabase, SourceData:= _
sRange).CreatePivotTable TableDestination:="", TableName:= _
"Draaitabel1", DefaultVersion:=xlPivotTableVersion10
Specifically on the TableDestination:="", statement.
It would seem obvious that there are some differences in VBA for excel 2000 and VBA for excel 2003. Can anyone help me here?
Thank you in advance!
RichardC_NL