Accessing excel file while excel object refers to it...

  • Thread starter Thread starter Wendi Taranto
  • Start date Start date
W

Wendi Taranto

I've written an excel import utility that uses the excel object model to
read records, cell by cell, in excel and import them into a database. The
problem I see happening is that when the utility is reading the excel file,
if I manually open the excel file, then I lose my object references in the
utility. Can anyone shed any light on as to why this happens. Also
accepting suggestions on how to lock the file/read only...if that even helps
in this case.

Thanks in advance for your expertise...

Wendi
 
This doesn't sound like it's a macro inside excel. (maybe real VB??).

Without too many details to go on, this might not even be close.

But could your VB (or whatever) program open the workbook in readonly mode:

Inside a VBA macro, I could do something like:

Dim wkbk As Workbook
Set wkbk = Workbooks.Open(Filename:="book1.xls", ReadOnly:=True)

Then anyone should be able to open it for editting.
 
Back
Top