Text to Columns in VBA returning "Object does not support this method" error
I am trying to format an excel spreadsheet through access, specifically trying to convert a column from text to dates (I receive the data in text format and need to translate it to dates).
I'm no longer getting an error, but it isn't actually modifying the spreadsheet...
I am trying to format an excel spreadsheet through access, specifically trying to convert a column from text to dates (I receive the data in text format and need to translate it to dates).
Code:
Dim excelApp As Object
Set excelApp = CreateObject("Excel.Application")
excelApp.screenupdating = False
excelApp.Visible = False
Set excelWB = excelApp.workbooks.Open("Z:\Data\BasicSMData.xlsx")
Set excelWS = excelWB.worksheets("ExportData")
excelApp.Columns("D:D").Select
excelApp.Selection.TextToColumns Destination:=excelApp.Range("D:D"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, _
Semicolon:=False, Comma:=False, Space:=False, Other:=False, FieldInfo _
:=Array(1, 5), TrailingMinusNumbers:=True
excelWB.Close SaveChanges:=True
[COLOR=red][/COLOR]
I'm no longer getting an error, but it isn't actually modifying the spreadsheet...
Last edited: