![]() |
vba excel fileopen
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 |
vba excel fileopen
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. " wrote: 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 |
vba excel fileopen
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). wrote: 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 -- Dave Peterson |
vba excel fileopen
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. |
vba excel fileopen
Good Choice
Getting it right is better than getting it fast If only users understood... " wrote: 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. |
All times are GMT +1. The time now is 04:17 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com