+ Reply to Thread
Results 1 to 5 of 5

vba excel fileopen

  1. #1
    rmanchu@gmail.com
    Guest

    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. #2
    Vacation's Over
    Guest

    RE: 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.

    "rmanchu@gmail.com" 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
    >
    >


  3. #3
    Dave Peterson
    Guest

    Re: 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).

    rmanchu@gmail.com 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

  4. #4
    rmanchu@gmail.com
    Guest

    Re: 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. #5
    Vacation's Over
    Guest

    Re: vba excel fileopen

    Good Choice

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

    "rmanchu@gmail.com" 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1