ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Close macro file (https://www.excelbanter.com/excel-programming/424099-close-macro-file.html)

MrRJ

Close macro file
 
Hi,

I have built a macro in which it has done it thing. Now, it is complete,
can I close the file that contains the macro too? Is that possible?

MrRJ

joel

Close macro file
 
try

application.quit

"MrRJ" wrote:

Hi,

I have built a macro in which it has done it thing. Now, it is complete,
can I close the file that contains the macro too? Is that possible?

MrRJ


Jim[_73_]

Close macro file
 
ActiveWorkbook.Close
' closes the active workbook and lets the user decide if
' changes are to be saved or not

On Feb 13, 2:26*pm, MrRJ wrote:
Hi,

I have built a macro in which it has done it thing. *Now, it is complete,
can I close the file that contains the macro too? *Is that possible?

MrRJ



joel

Close macro file
 
Jim: the problem is the saveas closes the oringal workbook and only nleaves
the saveas file opened. if yo want to go back to the original file you have
to re-open the workbook.

"Jim" wrote:

ActiveWorkbook.Close
' closes the active workbook and lets the user decide if
' changes are to be saved or not

On Feb 13, 2:26 pm, MrRJ wrote:
Hi,

I have built a macro in which it has done it thing. Now, it is complete,
can I close the file that contains the macro too? Is that possible?

MrRJ




MrRJ

Close macro file
 
Thanks guys. I didn't want to close the whole application, just in case the
user has other files open. So, I created a simple line with the specific
file name that the macro is being used.

I am all good.


"Joel" wrote:

Jim: the problem is the saveas closes the oringal workbook and only nleaves
the saveas file opened. if yo want to go back to the original file you have
to re-open the workbook.

"Jim" wrote:

ActiveWorkbook.Close
' closes the active workbook and lets the user decide if
' changes are to be saved or not

On Feb 13, 2:26 pm, MrRJ wrote:
Hi,

I have built a macro in which it has done it thing. Now, it is complete,
can I close the file that contains the macro too? Is that possible?

MrRJ





All times are GMT +1. The time now is 07:33 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com