I have written a module that opens another workbook. No problem. I have another module that switches the active window and copies some cells from it and than returns control to the previous window. This works just as it is, but will error out on a line if I save it as an addin or if I compile it. I set the following variable to remember the current workbook.
curwbname = ThisWorkbook.Name
At the end of the process I want to return control back the the workbook using the follow code.
Windows(curwbname).Activate \\This is where the error occurs
Sheets("Edit").Select
Why is this erroring out when it is saved as a Addin or if I compile the excel file.
curwbname = ThisWorkbook.Name
At the end of the process I want to return control back the the workbook using the follow code.
Windows(curwbname).Activate \\This is where the error occurs
Sheets("Edit").Select
Why is this erroring out when it is saved as a Addin or if I compile the excel file.