How to close a excel file using Macro coding?
Referring to the post in Worksheet Function
Once I open the file 1.xls, and try to run following Macro. There is an error message "Array exceeds the range" [Translation from Chinese] Sub Eric() Workbooks("E:\1.xls").Close End Sub Does anyone have any suggestions what wrong is the above code? and how to fix it? Thanks in advance for any suggestions Eric |
How to close a excel file using Macro coding?
You might try instead:-
Sub Eric() ActiveWorkbook.Close savechanges = True 'Or if you want False End Sub Mike "Eric" wrote: Referring to the post in Worksheet Function Once I open the file 1.xls, and try to run following Macro. There is an error message "Array exceeds the range" [Translation from Chinese] Sub Eric() Workbooks("E:\1.xls").Close End Sub Does anyone have any suggestions what wrong is the above code? and how to fix it? Thanks in advance for any suggestions Eric |
All times are GMT +1. The time now is 06:13 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com