vba excel fileopen

R

rmanchu

hi

with vba; i've got an excel workbook open as readonly and i need to
open the same
as writable to write some data.

Set XL_WB = XL_App.Workbooks.Open(FileName:=EXCEL_FILENAME,
ReadOnly:=True)
Set XL_WB_tmp = XL_App.Workbooks.Open(FileName:=EXCEL_FILENAME, _
ReadOnly:=False, _
IgnoreReadOnlyRecommended:=True)

but i keep getting a warning message saying the file is open and that
discarding the file wud result in changes being lost ...

excel won't open the same file twice, one readonly and other writable?

how to avoid this?

i DON'T want to close the readonly file. the excel file is shared
resource file. multiple users would access the file in readonly mode.
atleast in theory ...

please help
 
V

Vacation's Over

Ok this "Feature" is really there to prevent you from hurting yourself.....

but depending on what kinds of changes you want to be able to make
I think you could link the read only file to another file
open , change and save that file
and have the changes effective in the read only file.
 
D

Dave Peterson

You can only have one workbook open that has that name.

Maybe you could open another instance of excel and use that (but it kind of
looks like you're close to that already).
 
R

rmanchu

thanx guys

i think i'll just close the readonly file, open it as writable, use it,
close it, and open the file as readonly.

not elegant at all

but writes will happen on a less frequent basis, less than 1 in 5 i
estimate.

i'd rather save the memory (some computers in use are relatively old
with less than 256mb ram. won't be as responsive and i'd like though.
:(

:)

thanx again.
 
V

Vacation's Over

Good Choice

Getting it right is better than getting it fast
If only users understood...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top