+ Reply to Thread
Results 1 to 4 of 4

saveas worksheets without renaming workbook

  1. #1
    Registered User
    Join Date
    10-01-2011
    Location
    Pittsford, NY, USA
    MS-Off Ver
    Excel 2007
    Posts
    6

    saveas worksheets without renaming workbook

    Hello, Everyone,

    I’m trying to export two of the five worksheets in my Excel workbook as csv files. I have the following code, which works a charm:

    Please Login or Register  to view this content.
    But once these lines of code have run, a couple of things go very wrong
    * First, within my workbook, the two worksheets have been renamed as strFilenameYYY
    * Second, my entire workbook has been renamed strFilenameYYY

    How can I export the two worksheets without changing their names within the workbook and the name of the workbook itself?

    Thanks!
    Vincent
    Attached Files Attached Files
    Last edited by val64; 10-02-2011 at 03:40 PM. Reason: remove ambiguity

  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: saveas worksheets without renaming workbook

    You can't apply saveas to the worksheet. You need to export it then save the new workbook usinhg saveas.
    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: saveas worksheets without renaming workbook

    Try this
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    10-01-2011
    Location
    Pittsford, NY, USA
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: saveas worksheets without renaming workbook

    Thank you. I love a solution that adds only two lines of code and modifies only two others -- and works! You've been a great help.

+ 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