+ Reply to Thread
Results 1 to 3 of 3

Closing Excel Safely within a Web Environment

  1. #1
    Rodney
    Guest

    Closing Excel Safely within a Web Environment

    Hello, I run Excel and Word documents within an Internet Explorer
    environment which was developed using Dreamweaver.

    My problem is with excel, my excel document has a home page and and 24
    other pages that are used for individual tasks.

    The user can navigate through the spreadsheet by clicking on a button
    on the home page and clicking on the home button on the selected pages
    when they have completed their task.

    My issue is most of my users when finished usually just save and X out
    rather than use the home button to close down thus losing the
    hyperlinks - Can I write a macro so when the user is finished and they
    click on the x the spreadsheet will return to the home page and then
    save the document and maintain all by hyperlinks within the document.


  2. #2
    Norman Jones
    Guest

    Re: Closing Excel Safely within a Web Environment

    Hi Rodney,

    I am not familiar with your scenario, but in a conventional enviroronment I
    might adopt an approach like the following:

    Assume your button is assigned to, or calls, a close down macro in a
    standard module, say MyCloseMacro.

    In the standard module add a module level boolean flag (bFlag) and in the
    macro add line setting the flag to True, e.g:

    Option Explicit
    Public bFlag As Boolean

    '=====================>>
    Sub MyCloseMacro()
    bFlag = True

    'Various housework
    ThisWorkbook.Close
    End Sub
    '<<=====================


    In the workbook's ThisWorkbook module add something like:

    '=====================>>
    Private Sub Workbook_BeforeClose(Cancel As Boolean)

    If Not bFlag Then Call MyCloseMacro

    End Sub
    '<<=====================

    This is workbook event code and should be pasted into the workbook's
    ThisWorkbook module *not a standard module or a sheet module):

    ************************************************************
    Right-click the Excel icon on the worksheet
    (or the icon to the left of the File menu if your workbook is maximised)

    Select 'View Code' from the menu and paste the code.

    Alt-F11 to return to Excel.
    ************************************************************

    If you are not familiar with event procedures, visit ChipPearson's site and
    see his explanation:

    http://www.cpearson.com/excel/events.htm


    ---
    Regards,
    Norman



    "Rodney" <[email protected]> wrote in message
    news:[email protected]...
    > Hello, I run Excel and Word documents within an Internet Explorer
    > environment which was developed using Dreamweaver.
    >
    > My problem is with excel, my excel document has a home page and and 24
    > other pages that are used for individual tasks.
    >
    > The user can navigate through the spreadsheet by clicking on a button
    > on the home page and clicking on the home button on the selected pages
    > when they have completed their task.
    >
    > My issue is most of my users when finished usually just save and X out
    > rather than use the home button to close down thus losing the
    > hyperlinks - Can I write a macro so when the user is finished and they
    > click on the x the spreadsheet will return to the home page and then
    > save the document and maintain all by hyperlinks within the document.
    >




  3. #3
    Rodney
    Guest

    Re: Closing Excel Safely within a Web Environment

    Thanks I'll try it

    Regards
    Rodney


+ 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