I have this program that has recently stopped working because of one line. I am getting an error message "Run-time error Automation error Invalid forward reference, or reference to uncompiled type". The program is fairly long but I have narrowed the problem down to 2 lines.
Workbooks.Open Filename:=strFile
Sheets(1).Select
When I run the program or even step thru the program the Workbooks.Open Filename:=strFile does open the workbook. Actually it opens 2 other workbooks before it just fine. It even executes Sheets(1).Select for the 2 other workbooks. But on the 3rd workbook I get the run time error. Now I make sure the 1st sheet is select just to be safe but if all the 1st sheets are selected I can comment out the Sheets(1).Select and the whole program works with no problems. Maybe somebody else has experienced this error. If my explanation isn't clear enough let me know.
Thanks for your time
Arnold
Workbooks.Open Filename:=strFile
Sheets(1).Select
When I run the program or even step thru the program the Workbooks.Open Filename:=strFile does open the workbook. Actually it opens 2 other workbooks before it just fine. It even executes Sheets(1).Select for the 2 other workbooks. But on the 3rd workbook I get the run time error. Now I make sure the 1st sheet is select just to be safe but if all the 1st sheets are selected I can comment out the Sheets(1).Select and the whole program works with no problems. Maybe somebody else has experienced this error. If my explanation isn't clear enough let me know.
Thanks for your time
Arnold