Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Checking if an excel file is open in vba.

Status
Not open for further replies.

ammiller

Programmer
Nov 21, 2002
8
IE
OK,

I have a macro that opens up a spreadsheet and copies data into a new spreadsheet.
A problem I have encountered is when users run the macro but the data source spreadsheet is still open. The macro will only read what was on the last saved version of that spreadsheet.

How do I check if the file is already open? If it is I will put in an error message and close the macro.

I have tried to see what happens when I open a spreadsheet which is already open where I specify readonly = false. I would expect an error message, but instead the macro opens up a copy of the file as read-only.

Anyone any ideas?

Thanks

Aidan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top