Opening an Excel Spread sheet from within Access which links back to a table in Access?

andyfive

New Member
Joined
Mar 25, 2015
Messages
2
Hello All,

I have an Access Database with a table called Customers. I have a series of macros set up in Access, one of which needs to open an Excel spreadsheet (via some Vba code) to perform some formatting. The problem is, the spreadsheet has a link back to the Customers Table in the Access Database (the same one the macros are running from).

The Spreadsheet opens OK but the linked data is not being updated. I think that this is probably because the Access Database is locked.

Is there some way I can get this to work, by perhaps temporarily unlocking the Access Database/Customer Table? Or perhaps another way around this?

Many Thanks.
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
I have a series of macros set up in Access, one of which needs to open an Excel spreadsheet (via some Vba code) to perform some formatting.

Honestly, it would be best not to worry about formatting. If formatting must be done, do it on the Excel side alone, at a time when it's not connected to Access. I personally avoid links to Excel spreadsheets as much as possible (i.e., always) since Access doesn't play well with Excel this way. It's been a while but my recollection is that the workbook is locked (read-only) while connected to Access, which pretty much means you can't do anything to it. Since in this case you *are* trying to do something to it, it's just not going to work.
 
Upvote 0
Many Thanks for your reply xenou. I need the formatting to be able to pass the data from one Access table to another. The reason I wanted to open Excel from within Access was because it was inconvenient to have to split my Access macros in two, run the first set, close Access, open Excel to do the formatting, close Excel, Open Access again and then continue with the second set of Macros. It would have been much more convenient to run it all as on step within Access.

The solution has been to actually do the formatting from within an Access query and create a temporary table to work from (i.e. eliminate Excel from the process completely). Took a little time to convert the formatting commands from Excel to Access but all is working well now.

Anyway, thanks for verifying that the Excel root was not feasible, enabling me to successfully focus on an alternative solution.
 
Upvote 0

Forum statistics

Threads
1,221,893
Messages
6,162,659
Members
451,780
Latest member
Blake86

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top