+ Reply to Thread
Results 1 to 3 of 3

Command button - to copy active sheet and not save current workbook

  1. #1
    Registered User
    Join Date
    08-30-2007
    Location
    Orlando, Florida
    MS-Off Ver
    MS Excel 2007
    Posts
    50

    Command button - to copy active sheet and not save current workbook

    I have a template for an import to a database. I want to protect the template and use a command button to copy the active worksheet to a new workbook and not save the changes to the template:

    The code I am using behind the command button is as follows:
    Please Login or Register  to view this content.
    Unfortunately, although it seems to work fine on my box, others get a runtime error message:“Run-time error `9’. Subscript out of range.”

    How can change this code so it works on anybody's machine?

    Thanks

    Veronica
    Last edited by Leith Ross; 01-18-2008 at 07:12 PM.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello Veronica,

    Please remember to wrap your code. I did for you his time because you still a new poster.

    To wrap your code you can select all the code to be wrapped, and click the # symbol in the Message window or add the HTML code tags by hand. To add the tags by hand, type [code]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/code] after the last word in the code.

    Thanks,
    Leith Ross

  3. #3
    Registered User
    Join Date
    08-30-2007
    Location
    Orlando, Florida
    MS-Off Ver
    MS Excel 2007
    Posts
    50

    Thanks for the edit

    Thank you for the edit - I'll remember that for the future.

    My apologies.

    Veronica

    Still haven't solved my problem though.

+ 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