Thanks Thanks:  0
Likes Likes:  0
Results 1 to 4 of 4

Thread: re-opening a new workbook

  1. #1
    Board Regular
    Join Date
    Mar 2002
    Posts
    81
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi,

    I have used these lines:

    Set eap = CreateObject("Excel.Application")
    eap.Visible = True
    Set ewb = eap.Workbooks.Open("Eudims07PMPackagePMProgramS.xls")
    ewb.activate

    to open a workbook from another one. This works fine the first time. However once the workbook has been opened and closed (the workbook, not the excel program) This line won't re-open the workbook.

    Does anyone know how to deal with this?

    Cheers

    Ed

    [ This Message was edited by: Jackeb on 2002-04-29 02:03 ]

  2. #2
    Board Regular
    Join Date
    Apr 2002
    Location
    Surrey, United Kingdom
    Posts
    75
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi,

    Not sure why that is happening, though hopeully this may be of some use to you. I always open workbooks through VBA with the following code:

    Sub open_workbook()
    Workbooks.Open ("C:WINNTDesktopBook1.xls")
    End Sub

    I have never had a problem with reopening workbooks using this method.

    Nibbs

  3. #3
    Board Regular
    Join Date
    Mar 2002
    Posts
    81
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    cheers...

    it has got me too.... rather i guess it is catching the file somewhere and the code thinks that it is already open?

    Ed

  4. #4
    Board Regular
    Join Date
    Apr 2002
    Location
    Surrey, United Kingdom
    Posts
    75
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    That sounds likely. If you do use the code I suggested it will just reopen the file each time - if you have made changes and not saved, it will warn you that they will be discarded and give you an option to cancel.

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
  •