I need a VBS script that will copy all worksheets in a spreadsheet to a new spreadsheet. Save As does not work and neither does copy and paste.
I have the following VBS code taken from http://www.microsoft.com/technet/scriptcenter/resources/qanda/sept06/hey0918.mspx
which does everything I want except it only copies one spreadsheet and you have to know the name of the spreadsheet.
Set objExcel = CreateObject("Excel.Applic
objExcel.Visible = True
Set objWorkbook = objExcel.Workbooks.Open("C
Set objWorksheet = objWorkbook.Worksheets("Sh
Set objNewWorkbook = objExcel.Workbooks(2)
I need code that will do all worksheets and without knowing the names of the spreadsheets.
Thanks in advance.