Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HELP: importing excel data to tables: 65 K of blank rows

Status
Not open for further replies.

santosh1

Programmer
Apr 26, 2002
201
US
Hello,

currently each time I import a excel file with data into a table, approximately 65K rows(containing no data) are added to the table. How can I fix this? I will appreciate your help very much.

I am using the following statement to import the excel file into the table into the
SPECTRUM_CALCULATION table

DoCmd.TransferSpreadsheet acImport, nSpreadSheetType, "SPECTRUM_CALCULATION", _
cFileName, Me!ChkBox_FieldNames



Santosh
 
Try deleting all columns and rows in the spreadsheet that do not have any data. Or cut & paste the data into a new Excel file. The problem is most likely a rouge blank space in a cell within the Excel sheet. Steve Medvid
"IT Consultant & Web Master"

Chester County, PA Residents - Please Show Your Support...
 
Dear Santosh,


couldn't you use the last option to determine the range of your data??

DoCmd.TransferSpreadsheet [Transfertyp][, Spreadsheettyp], Tablename, filename [, fieldnames][, Range]

like this:

DoCmd.TransferSpreadsheet acImport, 3, _
"Personal","C:\Lotus\Newemps.wk3", True, "A1:G12"

HTH

regards Astrid
 
Hello,

I copied and pasted the data into new excel file. It works fine, must have been the blank spaces in the old file.
Is there a way I can dynamically find the range of the excel file that I can put into my code since the range keeps changing?

Thankyou for your help very much!

Santosh
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top