economistleo
Programmer
Hi,
I'm using Msqury to get external data from a website. One of the imported fields is an id string. the problem is that all of the characters in this string are numerical, and ms excel evaluates the id as such. Some of these id are larger than 17 digit, and so I lose some of my last digits. My question is, how can I setup the Wquery to import everything as string(text)? Is there a way to do so? Im using it in vba code: '
With ActiveSheet.QueryTables.Add(Connection:= _
urt, _
Destination:=Cells(1, 1))
.FieldNames = False
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = False
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = False
.AdjustColumnWidth = False
.RefreshPeriod = 0
.WebSelectionType = xlSpecifiedTables
.WebFormatting = xlWebFormattingNone
.WebTables = "2"
.WebPreFormattedTextToColumns = False
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
I've tried all kinds of combinations within these options, and had no success. Any thoughts or ideas?
Thanks,
Leo
I'm using Msqury to get external data from a website. One of the imported fields is an id string. the problem is that all of the characters in this string are numerical, and ms excel evaluates the id as such. Some of these id are larger than 17 digit, and so I lose some of my last digits. My question is, how can I setup the Wquery to import everything as string(text)? Is there a way to do so? Im using it in vba code: '
With ActiveSheet.QueryTables.Add(Connection:= _
urt, _
Destination:=Cells(1, 1))
.FieldNames = False
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = False
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = False
.AdjustColumnWidth = False
.RefreshPeriod = 0
.WebSelectionType = xlSpecifiedTables
.WebFormatting = xlWebFormattingNone
.WebTables = "2"
.WebPreFormattedTextToColumns = False
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
I've tried all kinds of combinations within these options, and had no success. Any thoughts or ideas?
Thanks,
Leo