Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
getting error out of memory
I'm Importing data from a text file to Excel, and everything is ok if I have
data in my text file, but I'm getting an out of memory error message at a ..Refresh BackgroundQuery:=False when my text file doesn't have data. How can I test if my text file is empty or not? Could somebody tell me why or what could I do about it??? this is my code... Range("A2").Select With ActiveSheet.QueryTables.Add(Connection:= _ "TEXT;C:\Hilda\Excel\WorryParts\WP1", Destination:=Range("A2")) .Name = "WP1_1" .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 = Array(1, 1, 1, 1) .TextFileTrailingMinusNumbers = True .Refresh BackgroundQuery:=False End With Thanks a lot. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
getting error out of memory
Test it with something like
if Dir("C:\Hilda\Excel\WorryParts\WP1") < "" Then if filelen(C:\Hilda\Excel\WorryParts\WP1) 100 then ' now your code. End if End if -- Regards, Tom Ogilvy "Hilda" wrote in message ... I'm Importing data from a text file to Excel, and everything is ok if I have data in my text file, but I'm getting an out of memory error message at a .Refresh BackgroundQuery:=False when my text file doesn't have data. How can I test if my text file is empty or not? Could somebody tell me why or what could I do about it??? this is my code... Range("A2").Select With ActiveSheet.QueryTables.Add(Connection:= _ "TEXT;C:\Hilda\Excel\WorryParts\WP1", Destination:=Range("A2")) .Name = "WP1_1" .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 = Array(1, 1, 1, 1) .TextFileTrailingMinusNumbers = True .Refresh BackgroundQuery:=False End With Thanks a lot. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to handle error 8007000e Memory Error | Excel Programming | |||
Out of Memory Error | Excel Programming | |||
Out of Memory Error | Excel Programming | |||
Out of Memory error | Excel Programming | |||
Out of memory error. | Excel Programming |