upload excel files to access ?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi:

What is a simple VB method
to upload an excel-type datasheet
into an Access database ?

Thanks,
Phil
 
Thanks Klatuu:

The following is failing with a "type mismatch" error:

Private Sub Form_Load()
DoCmd.TransferSpreadsheet "table3", "C:\test\test.xls", "A1"
End Sub

table3 field1 is type number and,
A1 is the number "1"

Any help would be appreciated.

Regards,
Phil
 
DoCmd.TransferSpreadsheet "table3", "C:\test\test.xls", "A1"
The arguments are incorrect. Look up TransferSpreadsheet method in VB Help.
Should be:
DoCmd.TransferSpreadsheet "table3", acImport, ??, "YourTable Name",
"C:\test\test.xls", False, "A1:A1"

Where the ?? is, you need to enter the acSpreadSheetType constant for the
version of Excle you are using. It is an optional arguement, but the default
is acSpreadsheetTypeExcel8. If you choose to use the default, just leave a
space between the commas where it goes so the arguments are in the correct
position
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top