Go Back   Access World Forums > Microsoft Access Discussion > Macros

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 03-10-2018, 09:33 AM   #1
sanal
Newly Registered User
 
Join Date: Mar 2018
Posts: 3
Thanks: 2
Thanked 0 Times in 0 Posts
sanal is on a distinguished road
transfer spread sheet macro

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 Cesktop\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 .

sanal is offline   Reply With Quote
Old 03-10-2018, 09:38 AM   #2
ridders
AWF VIP
Gold Supporter
 
ridders's Avatar
 
Join Date: Jan 2017
Location: Somerset, UK
Posts: 4,470
Thanks: 71
Thanked 1,097 Times in 1,025 Posts
ridders is a jewel in the rough ridders is a jewel in the rough ridders is a jewel in the rough ridders is a jewel in the rough
Re: transfer spread sheet macro

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
__________________
Colin
Access 2010 32-bit, Access 2016 32-bit & 64-bit, SQL Server Express 2014, Windows 10,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


If this answer has helped, please click the Thanks button and/or click the 'reputation scales' symbol on the left and leave a comment.

New example databases:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
ridders is offline   Reply With Quote
The Following User Says Thank You to ridders For This Useful Post:
sanal (03-11-2018)
Old 03-11-2018, 12:38 AM   #3
sanal
Newly Registered User
 
Join Date: Mar 2018
Posts: 3
Thanks: 2
Thanked 0 Times in 0 Posts
sanal is on a distinguished road
Re: transfer spread sheet macro

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.

sanal is offline   Reply With Quote
Old 03-11-2018, 12:52 AM   #4
ridders
AWF VIP
Gold Supporter
 
ridders's Avatar
 
Join Date: Jan 2017
Location: Somerset, UK
Posts: 4,470
Thanks: 71
Thanked 1,097 Times in 1,025 Posts
ridders is a jewel in the rough ridders is a jewel in the rough ridders is a jewel in the rough ridders is a jewel in the rough
Re: transfer spread sheet macro

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

__________________
Colin
Access 2010 32-bit, Access 2016 32-bit & 64-bit, SQL Server Express 2014, Windows 10,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


If this answer has helped, please click the Thanks button and/or click the 'reputation scales' symbol on the left and leave a comment.

New example databases:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Last edited by ridders; 03-11-2018 at 01:26 AM.
ridders is offline   Reply With Quote
The Following User Says Thank You to ridders For This Useful Post:
sanal (03-11-2018)
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Access spread sheet to web with pictures Public_library General 1 10-12-2005 10:06 AM
Excel Spread sheet instead of report gbanks Reports 1 03-04-2005 09:23 AM
Importing a spread sheet? gbanks General 1 11-01-2002 11:56 AM
Spread sheet? gbanks General 0 08-28-2002 07:26 AM
Convert Report into Excel Spread sheet cliffsimms Reports 2 12-05-2000 05:12 PM




All times are GMT -8. The time now is 04:13 PM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Sponsored Links

How to advertise

Media Kit


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World