Hello all,
I have the following issue that I would really appreciate some help on:
I have a third party application (AB) that generates an output that can be exported to an excel workbook. The workbook is automatically named "Book1.xlsx". I would like to manipulate "Book1.xlsx" from a macro in another workbook "Study_Control.xlsm". So AB creates "Book1.xlsx", its open and has not yet been saved. It is at this point in the process, I'll call it [1], that I would like to run a macro in "Study_Control.xlsm" to manipulate "Book1.xlsx". My problem is this: "Book1.xlsx" is not added to the Workbooks collection until after it is saved, closed and then reopened. I have confirmed that this is the case by iterating the Workbooks collection before and after "Book1.xlsx" is saved, closed and then reopened. Before saving, closing and reopening I get a "subscript out of range" error, after saving, closing and reopening "Book1.xlsx" it is a member of the collection an can therefore be manipulated.
Is there any way for me to reference "Book1.xlsx" at [1] as defined above? Manual manipulation of "Book1.xlsx" is not an option as this process needs to be repeated many thousands of times.
Thanks for your help,
Regards Ray
I have the following issue that I would really appreciate some help on:
I have a third party application (AB) that generates an output that can be exported to an excel workbook. The workbook is automatically named "Book1.xlsx". I would like to manipulate "Book1.xlsx" from a macro in another workbook "Study_Control.xlsm". So AB creates "Book1.xlsx", its open and has not yet been saved. It is at this point in the process, I'll call it [1], that I would like to run a macro in "Study_Control.xlsm" to manipulate "Book1.xlsx". My problem is this: "Book1.xlsx" is not added to the Workbooks collection until after it is saved, closed and then reopened. I have confirmed that this is the case by iterating the Workbooks collection before and after "Book1.xlsx" is saved, closed and then reopened. Before saving, closing and reopening I get a "subscript out of range" error, after saving, closing and reopening "Book1.xlsx" it is a member of the collection an can therefore be manipulated.
Is there any way for me to reference "Book1.xlsx" at [1] as defined above? Manual manipulation of "Book1.xlsx" is not an option as this process needs to be repeated many thousands of times.
Thanks for your help,
Regards Ray