transfer spread sheet macro (1 Viewer)

sanal

Registered User.
Local time
Today, 19:08
Joined
Mar 10, 2018
Messages
11
The transfer spread sheet macro I created for importing data from excel files to access table not working. The file path correctly noted in the file path but it is not recognized by the macro. I want to import data from 5 excel workbooks to 5 access tables. The file path I have given is C:Desktop\LOCIS\workbookName
The excel workbook names and access file names are same in all cases. I request help to build the transfer spreadsheet macro with an example .
 

isladogs

MVP / VIP
Local time
Today, 14:38
Joined
Jan 14, 2017
Messages
18,209
Did you remember the '.xlsx' or .xls' at the end of the file name?

Suggest you do a Debug.Print line to check the file path output is correct
 

sanal

Registered User.
Local time
Today, 19:08
Joined
Mar 10, 2018
Messages
11
Thanks ridders for your reply.The transfer spread sheet macro now worked smoothly. But my problem now is when the database is used in another computer or the file is in a different folder the path mentioned in the macro becomes false and hence the macro does'nt work then. How can we overcome this situation. Is there any way the macro prompt the user to locate the excel file each time it runs.
 

isladogs

MVP / VIP
Local time
Today, 14:38
Joined
Jan 14, 2017
Messages
18,209
Depends on how you are setting this up.
If the files will always be in the same location on that computer, you can save the location as a field name...or get the user to browse for the file and use that location etc ...

However, I never use macros so can't advise on specific details of this.

Good luck

EDIT: Cross posted at: http://www.accessforums.net/showthread.php?t=71000
Please follow forum guidelines about crossposting
 
Last edited:

Users who are viewing this thread

Top Bottom