+ Reply to Thread
Results 1 to 3 of 3

Checking whether .xls file was just opened from a template

Hybrid View

  1. #1
    BethA
    Guest

    Checking whether .xls file was just opened from a template

    I would like to use in my Workbook_Open event handler the GetSaveAsFileName
    method to have the user name the workbook. I want to "suggest" the file name
    for the user (which would include the current date). But I only want to do
    this when the file is created from my template. I don't want to do this every
    time the workbook is opened.

    I could do some kind of check on the current file name (to see if it's in
    the "template1.xls" form), but that means changing code if we change the
    template name. That's likely to happen since we may make 50 different version
    for different customers. I'm hoping there's another way to check this.

    Hope this makes sense! Any ideas? Thanks!

    Beth A.

  2. #2
    Tom Ogilvy
    Guest

    Re: Checking whether .xls file was just opened from a template

    If thisworkbook.path = "" then
    fName = Application.GetSaveAsFilename . . .

    --
    Regards,
    Tom Ogilvy


    "BethA" <BethA@discussions.microsoft.com> wrote in message
    news:5C5F9A64-EF23-45DB-BF74-E0CCD88FD21A@microsoft.com...
    > I would like to use in my Workbook_Open event handler the

    GetSaveAsFileName
    > method to have the user name the workbook. I want to "suggest" the file

    name
    > for the user (which would include the current date). But I only want to do
    > this when the file is created from my template. I don't want to do this

    every
    > time the workbook is opened.
    >
    > I could do some kind of check on the current file name (to see if it's in
    > the "template1.xls" form), but that means changing code if we change the
    > template name. That's likely to happen since we may make 50 different

    version
    > for different customers. I'm hoping there's another way to check this.
    >
    > Hope this makes sense! Any ideas? Thanks!
    >
    > Beth A.




  3. #3
    BethA
    Guest

    Re: Checking whether .xls file was just opened from a template

    Thanks Tom - that's perfect! And I should have known that...

    Beth A.

    "Tom Ogilvy" wrote:

    > If thisworkbook.path = "" then
    > fName = Application.GetSaveAsFilename . . .
    >
    > --
    > Regards,
    > Tom Ogilvy
    >
    >
    > "BethA" <BethA@discussions.microsoft.com> wrote in message
    > news:5C5F9A64-EF23-45DB-BF74-E0CCD88FD21A@microsoft.com...
    > > I would like to use in my Workbook_Open event handler the

    > GetSaveAsFileName
    > > method to have the user name the workbook. I want to "suggest" the file

    > name
    > > for the user (which would include the current date). But I only want to do
    > > this when the file is created from my template. I don't want to do this

    > every
    > > time the workbook is opened.
    > >
    > > I could do some kind of check on the current file name (to see if it's in
    > > the "template1.xls" form), but that means changing code if we change the
    > > template name. That's likely to happen since we may make 50 different

    > version
    > > for different customers. I'm hoping there's another way to check this.
    > >
    > > Hope this makes sense! Any ideas? Thanks!
    > >
    > > Beth A.

    >
    >
    >


+ 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