I am working in Excel version 6.5 and the following code opens the workbook but the attempt to copy gives "Subscript out of range" error.
The "Source" w/Book is known to have all the sheets named and the "Recipient w/book is known to have only one sheet.
MyBook is the total path plus file name plus extension (.xlsx).
How can I find out which "Subscript" is causing the error?
I have checked that the sheet names do not have any unwanted leading or trailing spaces but otherwise I am lost!Code:Workbooks.Open Filename:=MyBook ' Open the "Source" W/Book ' Copy the sheets over Workbooks(MyBook).Sheets(Array("Income", "Expenditure", "Transfers", "Standing orders", "Consolidation", "Schedule B", _ "Budget")).Copy Before:=Workbooks(ThisWorkbook.Name).Sheets(1) ' ******************** Close the Slave WorkBook ******************* Workbooks(MyBook).Close
I would appreciate any help.




Reply With Quote