D
dhgerstman
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
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