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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access Programming ---> Excel

Status
Not open for further replies.

MyerK

Programmer
Mar 23, 2002
18
US
I'm attempting to manipulate an excel spreadsheet from within Access (add worksheet, move worksheet, rename worksheet, alter cells, save, etc).

Quite often when I open the spreadsheet from within Excel to see if I was successful in programming from Access, I get a message that the spreadsheet is locked and can only be viewed.

My only recourse is to copy the spreadsheet and changed the name in my program. This persists for anywhere from a little while to permanently.

Any ideas what's causing this and how to avoid it?

Thanks.


 
You get that message if the spreadsheet is opened by another program or user. The rule in Excel is that the first user who opens a spreadsheet gets read/write access, while subsequent users get read only. You must not be closing something somewhere. Recheck your code and place a .close statement where you finish manipulating the sheet.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top