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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Wrestling With Spreadsheet Import Control 1

Status
Not open for further replies.

TravisT42

Technical User
Jan 7, 2008
7
US
Hello all,

VBA coder newb here. Searched the forums and found a useful function here thread705-760625.

I put this code into a module, not a class module. The control I'm using is in a subform and I have entered the following into the click event procedure:

Code:
GetFile ("[FileName]")
    DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel3, "tblLI", "[FileName]", True

The file select dialog comes up just fine, but whether I select a file or not, I keep getting a type mismatch error. I modified the code I found in that linked thread to show .xls files only. Any help on what it is I've done wrong?
 
Try:

[tt]Call GetFile
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel3, "tblLI", FileName, True[/tt]

Generally functions should not work in quite the way that the thread illustrates.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top