The following code imports “temp.xls” into an access table “import”. However it fails if temp.xls does not contain any data:
ResultCode = Worksheet.SaveAs("C:\temp.xls", 4, 0)
*** see below
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "import", "C:\temp.xls", False, ""
*** Here I would like to add code which:
1) checks if temp.xls is 3584 bytes in which case it has no data, and
2) then copies over temp.xls with temp2.xls. Temp2.xls has zeros and the import then works.
Something like this:
if c:\temp.xls = 3584 bytes, copy c:\temp2 c:\temp.xls
Any help would be greatly appreciated!
Hans
Zurich
ResultCode = Worksheet.SaveAs("C:\temp.xls", 4, 0)
*** see below
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "import", "C:\temp.xls", False, ""
*** Here I would like to add code which:
1) checks if temp.xls is 3584 bytes in which case it has no data, and
2) then copies over temp.xls with temp2.xls. Temp2.xls has zeros and the import then works.
Something like this:
if c:\temp.xls = 3584 bytes, copy c:\temp2 c:\temp.xls
Any help would be greatly appreciated!
Hans
Zurich