Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
How to close a excel file using Macro coding?
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 |
#2
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
How to close a excel file using Macro coding?
Try:
Workbooks("1.xls").Close "Eric" wrote: 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 |
#3
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
How to close a excel file using Macro coding?
Workbooks("1.xls").Close
You don't specify the drive and path when you use that workbooks(...) collection. Eric wrote: 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 -- Dave Peterson |
#4
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
How to close a excel file using Macro coding?
I already specify the drive and path, but it still does not work.
Does anyone know how to solve this coding for closing a file? Thank for any suggestions Eric "Dave Peterson" wrote: Workbooks("1.xls").Close You don't specify the drive and path when you use that workbooks(...) collection. Eric wrote: 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 -- Dave Peterson |
#5
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
How to close a excel file using Macro coding?
Don't specify the drive and path.
Do NOT specify the drive and path. Eric wrote: I already specify the drive and path, but it still does not work. Does anyone know how to solve this coding for closing a file? Thank for any suggestions Eric "Dave Peterson" wrote: Workbooks("1.xls").Close You don't specify the drive and path when you use that workbooks(...) collection. Eric wrote: 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 -- Dave Peterson -- Dave Peterson |
#6
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
How to close a excel file using Macro coding?
Thank everyone for suggestions
The following code is created under Report.xls When I open Report.xls, then go to toolsMarcro, select Updating and click RUN button, then it opens 1.xls file, save it and close it. However, when I open Report.xls, use the hot key Ctrl+Shift+u, it is still able to open 1.xls file, but it does not able to save it and close it. Do you have any suggestions what wrong it is when I use the hot key to run macro? Sub Updating() ' Ctrl+Shift+u for hot key Workbooks.Open Filename:="C:\files\1.xls", UpdateLinks:=3 Workbooks("1.xls").Activate Workbooks("1.xls").Save Workbooks("1.xls").Close End Sub Thank everyone very much for suggestions Eric "Dave Peterson" wrote: Don't specify the drive and path. Do NOT specify the drive and path. Eric wrote: I already specify the drive and path, but it still does not work. Does anyone know how to solve this coding for closing a file? Thank for any suggestions Eric "Dave Peterson" wrote: Workbooks("1.xls").Close You don't specify the drive and path when you use that workbooks(...) collection. Eric wrote: 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 -- Dave Peterson -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to close a excel file using Macro coding? | Excel Discussion (Misc queries) | |||
How to code the Macro to save and close a file? | Excel Discussion (Misc queries) | |||
Macro to Open, then Close another File | Excel Discussion (Misc queries) | |||
recrding macro,copy data thn close file, get messge abut clpbord | Excel Discussion (Misc queries) | |||
macro to close excel | Excel Discussion (Misc queries) |