Results 1 to 7 of 7
  1. #1
    Lounger
    Join Date
    Jul 2002
    Location
    Sun Prairie, WI, USA
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Excel files in IE (XL2000)

    (This may be more of a web subject, but it has to do with an Excel file, so bear with me...)

    I'm developing a very simple web page with a link to an Excel file.
    Click the link and the workbook opens. Great. As it should be.
    Make some changes (even simple things like switching sheet tabs).
    Click the BACK button and IE stops to ask whether you'd like to save your changes. I DON'T WANT THIS TO HAPPEN.
    Is there a way to make Excel ignore any and all changes made to a workbook?
    Furthermore, is there a way to make IE use the parameters available in VBA Open method for a workbook?

    Make any sense?

  2. #2
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Excel files in IE (XL2000)

    In the Workbook Close event routine, you could set the Saved property to True. I don't know how this would work in a workbook opened in IE and I don't have any way to test it.

    You might also try doing that in the Workbook Before Save event routine and in addition set the Cancel parameter to True.
    Legare Coleman

  3. #3
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Excel files in IE (XL2000)

    <<Furthermore, is there a way to make IE use the parameters available in VBA Open method for a workbook>>

    AFAIK the Workbook_Open event sub does not take any parameters, so could you enlighten me as to what you are referring to?
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Excel files in IE (XL2000)

    Jan Karel,

    The post mentions the Open method of a workbook - I suppose the Workbooks.Open method was meant:

    Workbooks.Open(FileName, UpdateLinks, ReadOnly, Format, Password, WriteResPassword, IgnoreReadOnlyRecommended, Origin, Delimiter,
    Editable, Notify, Converter, AddToMRU)

  5. #5
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Excel files in IE (XL2000)

    <img src=/S/hiding.gif border=0 alt=hiding width=70 height=24>
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

  6. #6
    Lounger
    Join Date
    Jul 2002
    Location
    Sun Prairie, WI, USA
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Excel files in IE (XL2000)

    Hans is correct. I was referring to the Workbooks.Open method. We use this frequently to open another workbook from within Excel. It's just one example of where I remembered that you could tell Excel to open another workbook as read-only.

    Ultimately, this is what I want to happen in my browser. That way, when you go BACK, IE will ignore any changes you may have made and not prompt to save changes.

  7. #7
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Excel files in IE (XL2000)

    Alternatively, you could create a before_close event sub and include this line at the end of it. In the Thisworkbook module:

    Private Sub Workbook_BeforeClose(Cancel As Boolean)
    Thisworkbook.Saved=True
    End Sub

    To be sure no-one tries to save it, also create a before_save event with this code:

    Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
    Cancel = Not bCanSave
    bCanSave=False
    End Sub

    And in a normal module:

    Public bCanSave as Boolean

    Private Sub EnableSave()
    bCanSave=True
    End Sub
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

Posting Permissions

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