C
C Brandt
I have a spread sheet that I use VBA to import other files. I re-import
every day to keep the sheet up-to-date. In general I identify areas of the
spread sheet with names and access them that way. I have noticed that when I
import a file, it creates a NAME in the spread sheet as is specified by the
third line in the IMPORT routine (example follows). After the first one it
starts appending a number after the name. Very annoying! Since I don't
actively use them:
1) is there any reason that I need this name?
and
2) is there a way to prevent it from occuring?
Thanks,
Craig
With ActiveSheet.QueryTables.Add(Connection:= _
"TEXT;" & POSPath & POSName & "", Destination:=Range("D2"))
.Name = "position"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.TextFilePromptOnRefresh = False
.TextFileStartRow = 1
.TextFileParseType = xlDelimited
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = False
.TextFileTabDelimiter = True
.TextFileSemicolonDelimiter = False
.TextFileCommaDelimiter = True
.TextFileSpaceDelimiter = False
.TextFileColumnDataTypes = Array(5, 1, 1, 1, 1, 1, 1)
.Refresh BackgroundQuery:=False
End With
every day to keep the sheet up-to-date. In general I identify areas of the
spread sheet with names and access them that way. I have noticed that when I
import a file, it creates a NAME in the spread sheet as is specified by the
third line in the IMPORT routine (example follows). After the first one it
starts appending a number after the name. Very annoying! Since I don't
actively use them:
1) is there any reason that I need this name?
and
2) is there a way to prevent it from occuring?
Thanks,
Craig
With ActiveSheet.QueryTables.Add(Connection:= _
"TEXT;" & POSPath & POSName & "", Destination:=Range("D2"))
.Name = "position"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.TextFilePromptOnRefresh = False
.TextFileStartRow = 1
.TextFileParseType = xlDelimited
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = False
.TextFileTabDelimiter = True
.TextFileSemicolonDelimiter = False
.TextFileCommaDelimiter = True
.TextFileSpaceDelimiter = False
.TextFileColumnDataTypes = Array(5, 1, 1, 1, 1, 1, 1)
.Refresh BackgroundQuery:=False
End With