Validate File before imort

J

John

I have an "import" button on a form that prompts the user to select a file to
import. The file must be an Excel file that contains the proper data. The
import works great, but now I am trying to "idiot proof" the code. How is
this best done? I need to check the type of file they selected (IE: type =
XLS) and some key information in the second record of the sheet. Here's the
code I am using to import:


DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel5, "tblMonthly",
fn, True

Does the "...acSpreadsheetTypeExcel5..." ensure that it's an excel
spreadsheet?
 
B

bhicks11 via AccessMonster.com

Oops, sorry John - I thought you were trying to limit to Excel 5.
I am not sure I follow you bhicks11... How does this answer my question?
Excel 5, being backwardly compatible, would allow older versions.
[quoted text clipped - 14 lines]
 

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

Top