ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Macro (https://www.excelbanter.com/excel-discussion-misc-queries/23005-macro.html)

buzb

Macro
 
I am trying to record a macro which will automatically close my workbook from
an assigned button. When I begin the recording process and then perform the
action of closing the workbook the macro is also closed and I cannot complete
the process. When I re-open my workbook the macro has not been created. Any
suggestions of a way around this would be much appreciated.

papou

Hi
Depending on whether you want to save your workbook before closing it:
Thisworkbook.Close(True)
Or not
Thisworkbook.Close(False)

HTH
Cordially
Pascal

"buzb" a écrit dans le message de news:
...
I am trying to record a macro which will automatically close my workbook
from
an assigned button. When I begin the recording process and then perform
the
action of closing the workbook the macro is also closed and I cannot
complete
the process. When I re-open my workbook the macro has not been created.
Any
suggestions of a way around this would be much appreciated.




buzb

Fantastic! I've spent all day trying to figure this one out and you've
probably saved me many more days. Thanks.

"buzb" wrote:

I am trying to record a macro which will automatically close my workbook from
an assigned button. When I begin the recording process and then perform the
action of closing the workbook the macro is also closed and I cannot complete
the process. When I re-open my workbook the macro has not been created. Any
suggestions of a way around this would be much appreciated.



All times are GMT +1. The time now is 08:44 PM.

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