Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 279
Default 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


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 279
Default 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.




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
fileopen A-Design Excel Programming 4 November 22nd 04 05:52 PM
Test fileOpen Luis Excel Programming 1 August 5th 04 02:04 AM
Macro to run on fileopen for all workbooks aarti Excel Programming 1 May 21st 04 01:37 PM
Using FileOpen Tippy Excel Programming 1 March 4th 04 06:55 PM
Selecting a file path in Excel VBA using FileOpen dialog John Robinson Excel Programming 1 November 1st 03 09:59 AM


All times are GMT +1. The time now is 04:18 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"