LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Saving a worksheet to a new workbook

I am trying to copy a worksheet to a new workbook and then close the
current workbook, so I can work in the worksheet.
This is what I've written.
Worksheets("Source_Worksheet").Activate
ActiveSheet.Copy
ActiveSheet.Paste
ActiveSheet.SaveAs "c:\My Excel Files\" & wsname & ".xls"
Workbooks("Source_Workbook.xls").Close

When I try the SaveAs, I get a run-time 1004 error for a bad path or
file name. (wsname is a string data type.)

David
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Saving a Worksheet/Workbook with VALUES ONLY CAT Excel Discussion (Misc queries) 4 October 2nd 08 06:50 PM
Saving Worksheet/Workbook via CommandButton WLMPilot Excel Programming 1 November 14th 06 11:37 PM
Saving into 1 workbook as a different worksheet dataman777 Excel Worksheet Functions 0 August 30th 05 11:37 PM
When saving workbook only the first worksheet gets saved. Debutante Excel Worksheet Functions 5 December 18th 04 01:31 AM
Saving a worksheet out of a workbook Fred Holmes Excel Programming 3 June 15th 04 09:12 PM


All times are GMT +1. The time now is 01:18 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"