opening excel from word document...

cmchenry

New Member
Joined
Jan 21, 2005
Messages
1
Hi. I have created a word merge document that takes some values (using vba) entered by users and opens up an excel spreadsheet and copies those values to the worksheet and saves it. The problem is that sometimes more than one user will be doing this and only one worksheet can be opened up at a time. If someone runs the letter and it opens up the excel spreadsheet when it is open at someone's computer already, is there some code I can use (i.e., an error code or something) that I can use in a loop so that the program will recognize that the spreadsheet is already open and loop through some numbers (i.e, so that will wait for a couple of seconds) and then test again to see if the spreadsheet can be opened...
I know exactly how I would do it, but I just need to error code (or something like that) that can be identified by the vba in word so that it can recognize that the excel spreadsheet is opened by someone else. Any help you can provide would be much appreciated!!
Thanks.
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.

Watch MrExcel Video

Forum statistics

Threads
1,129,550
Messages
5,636,962
Members
416,952
Latest member
prakashkumar

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
Top