I have recorded and modified a macro to link an access database to excel. I have very little experience with VB and am having a few problems.
1: When I use the string filenm that is pulled from the worksheet for the file path I get the following error:
Data file: ‘C:\file.mdb’ not found. Would you like to connect to C:\file.mdb instead?
When the file name is hard coded I do not get this error, any way to get rid of this error?
2: How can I import only specific columns from the database table?
3: The data files I need to work with do not have an .mdb extension (they are db1, lf1, etc). The files are opened with access and when I replace the .db1 or other extensions with .mdb excel correctly imports all data. However, when left in the original .db1 form I get a window to “Enter MS JET OLE DB Initialization Information” and I can’t get the data to import. Can anyone help with accessing a database with out an .mdb extension?
Here is the code I'm using:
Thanks for any help.
Bookmarks