+ Reply to Thread
Results 1 to 6 of 6

Use getsaveasfilename variant to activate workbook

  1. #1
    Registered User
    Join Date
    05-18-2010
    Location
    Connecticut
    MS-Off Ver
    Excel 2003
    Posts
    3

    Use getsaveasfilename variant to activate workbook

    Hello, I'm trying to use a variant assigned to the getsaveasfilename function to activate a workbook. Here is the existing code:
    Please Login or Register  to view this content.
    When the program gets to the last line of code, it always returns a "subscript out of range" error. What am I missing? Thanks.
    Last edited by royUK; 05-19-2010 at 01:26 AM.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Use getsaveasfilename variant to activate workbook

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here

    Added this time
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Use getsaveasfilename variant to activate workbook

    The new work book will be the active workbook

    You can't save a workbook with macros as *.xlsx, it must be *.xlsm

  4. #4
    Registered User
    Join Date
    05-18-2010
    Location
    Connecticut
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Use getsaveasfilename variant to activate workbook

    Thanks RoyUK, sorry about the formatting issue. I used the .xlsx extension because I want the workbook to be macro free when I run the save-as script. I'm not sure I understand your comment about the new work book being active. I'm looking to have the user specify a save-as file name, save the file, switch to another workbook, and then re-activate the original workbook that the user specified through the FileSaveName variant. What I'm stuck on is that last part, re-activating the original workbook. Any more thoughts by yourself or others would be greatly appreciated. Thanks.

  5. #5
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Use getsaveasfilename variant to activate workbook

    You cannot have code in a2007 workbook and save it with the *.xlsx format toremove code.

    I'mnot sure what you are doing so add an example workbook

  6. #6
    Registered User
    Join Date
    05-18-2010
    Location
    Connecticut
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Use getsaveasfilename variant to activate workbook

    Perhaps I've confused things by putting in the part about the extension. All I really need to know is how to use the Windows(........).Activate function with a filename specified by the saveasfilename function. What is it that I put in the (.......) part to make it work?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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