Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 3 of 3

Thread: Use a macro to open another woorkbook?

  1. #1
    New Member
    Join Date
    Mar 2002
    Posts
    13
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Is there cade I can put in the Beforeclose module of a workbook, to open another woorbook?

    workbook.open c:Updates.xls

    Thanks
    Wrecker

  2. #2
    MrExcel MVP Barrie Davidson's Avatar
    Join Date
    Feb 2002
    Location
    Winnipeg
    Posts
    2,330
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    On 2002-03-04 17:05, Wrecker wrote:
    Is there cade I can put in the Beforeclose module of a workbook, to open another woorbook?

    workbook.open c:Updates.xls

    Thanks
    Wrecker
    Sure, try
    Code:
    Private Sub Workbook_BeforeClose(Cancel As Boolean)
    Workbooks.Open FileName:="C:Updates.xls"
    End Sub
    Note - you only need one backslash (the board posts two for some reason).

    Regards,

    _________________

    Barrie Davidson
    My Excel Web Page

    [ This Message was edited by: Barrie Davidson on 2002-03-04 17:12 ]

  3. #3
    MrExcel MVP Anne Troy's Avatar
    Join Date
    Feb 2002
    Location
    Westwood NJ
    Posts
    2,582
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    You can record that macro. Store it in the Workbook, then rename it. Here's the code:

    Private Sub Workbook_BeforeClose(Cancel As Boolean)
    Workbooks.Open Filename:="C:WINDOWSDesktopMyfile.xls"
    End Sub
    ~Anne Troy

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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