Results 1 to 11 of 11
  1. #1
    5 Star Lounger
    Join Date
    Apr 2001
    Location
    Arriving Somewhere but not Here
    Posts
    698
    Thanks
    0
    Thanked 0 Times in 0 Posts

    showing forms and templates (XL97 sr2 on Win 2000/NT4)

    If I put

    <pre>Sub Workbook_open()
    frmStartupSplash.Show
    End Sub</pre>


    into the 'ThisWorkbook' sheet of my XL template then my splash screen displays when I OPEN the template. However, when I create a NEW file based on the template the splash screen doesn't appear.

    Where should I be puting the code to make the form visible when I click File | New?

    stuck

  2. #2
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: showing forms and templates (XL97 sr2 on Win 2000/NT4)

    Is this template the "default workbook template"?

    In XL97 this is a file named "book.xlt" that is stored in the XLStart folder or the "alternate startup folder".

    The default workbook template is used (if available) as the template with File - New.

    Steve

  3. #3
    5 Star Lounger
    Join Date
    Apr 2001
    Location
    Arriving Somewhere but not Here
    Posts
    698
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: showing forms and templates (XL97 sr2 on Win 2000/NT4)

    No, it is one of my creation and it is in the correct folder.

    To get at it so I can work on it, I right click the file name in Explorer and choose OPEN. in this case it displays my splash screen and the XL tilt bar correctly shows "filename.xlt".

    However, if in Explorer I right click and choose NEW or inside Excel I click File | New and select the file then when it opens the splash screen does not appear and the XL title bar correctly shows "filename1"

    I forgot to mention in my original post, I have tried using workbook_new in place of workbook_open but the splash screen still doesn't appear.

    stuck

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

    Re: showing forms and templates (XL97 sr2 on Win 2000/NT4)

    I just created a Template under XL2K with code in the Workbook_Open event routine and it worked when I create a new workbook based on the template using File New. Since your procedure name is Workbook_open() with a small "o" on open, I question if you really have this code in the Workbook_Open event routine since the template event routine has a capital "O" on Open. Could you upload a copy of a template that does not work so we can look at it?
    Legare Coleman

  5. #5
    5 Star Lounger
    Join Date
    Apr 2001
    Location
    Arriving Somewhere but not Here
    Posts
    698
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: showing forms and templates (XL97 sr2 on Win 2000/NT4)

    I'm sorry but I can't post the template in question but I can report further...

    I checked my use of Workbook_Open by creating a nice clean blank template with nothing in it except a form comprising one label. This behaves as it should, selecting either New or Open from a right click in Explorer displays the form on openning.

    Next step was to copy the form from my misbehaving template to the test template. This too behaves correctly. Conclusion, there is something dark and mysterious screwing up my real template.

    I'll be back once I get my head out from under the bonnet (car hood to those of you over the pond).

    stuck

  6. #6
    5 Star Lounger
    Join Date
    Apr 2001
    Location
    Arriving Somewhere but not Here
    Posts
    698
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: showing forms and templates (XL97 sr2 on Win 2000/NT4)

    Further to my last post....I have a nomination for "daft question of the day":

    Is there a pain free way to rebuild a template that includes loads of named ranges used to generate dynamic ranges of charts?

    Copying stuff over to a new workbook sorts the Workbook_Open problem but it's going to be major grief to sort out all the references.

    stuck

  7. #7
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: showing forms and templates (XL97 sr2 on Win 2000/NT4)

    This will add the names from Book1 to Book2. Change names as appropriate.
    Steve

    Option Explicit
    <pre>Sub CopyNames()
    Dim wkbFrom As Workbook
    Dim wkbTo As Workbook
    Dim nName As Name

    Set wkbFrom = Workbooks("book1")
    Set wkbTo = Workbooks("book2")

    For Each nName In wkbFrom.Names
    wkbTo.Names.Add _
    Name:=nName.Name, _
    RefersTo:=nName.RefersTo
    Next
    End Sub
    </pre>


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

    Re: showing forms and templates (XL97 sr2 on Win 2000/NT4)

    I believe that Jan Karel's Name Manager should help you do this.
    Legare Coleman

  9. #9
    5 Star Lounger
    Join Date
    Apr 2001
    Location
    Arriving Somewhere but not Here
    Posts
    698
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: showing forms and templates (XL97 sr2 on Win 2000/NT4)

    So there really is a Santa Claus! I will look into this but I suspect not till the new year.

    Thanks,

    stuck

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

    Re: showing forms and templates (XL97 sr2 on Win 2000/NT4)

    One other thing that you might want to try that would be a lot easier. If you have an XL2K system, then save the file in HTML format, then close Excel, Open Excel and open the HTML file. Then save the file back as .xls format. This will sometimes clean up this kind of problem.
    Legare Coleman

  11. #11
    5 Star Lounger
    Join Date
    Apr 2001
    Location
    Arriving Somewhere but not Here
    Posts
    698
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: showing forms and templates (XL97 sr2 on Win 2000/NT4)

    Thanks for the tip. My local version of XL is 97 but I can get to a networked version of XL2K via our Citrix server (ARGHHHH!).

    I fear I must go for the complete rebuild though <img src=/S/weep.gif border=0 alt=weep width=21 height=16>. Late yesterday having filled it with test data it crashed and now every time I try and open the file it brings XL down instantly. Fortunately I have a back up that is accessible.

    stuck (but not completely!)

Posting Permissions

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