• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Help on Macro

Shijith

New Member
Hi,

I have created a macro to move and save all work sheets (except few) to a selected path. Macro is running fine for the first time, However excel is closing automatically when i tried to run this for second time.

It works fine if i closed the workbook and reopened.

Can anybody help me on this.

Please find attached the excel file.

Thanks in advance,

VKS
 

Attachments

  • SHIJITH.xlsm
    30.2 KB · Views: 4
Hi:

I have not tested your macro. However, I have skimmed through your code and found that your test subroutine is having a line called ActiveWindow.Close, may be the closing of your workbook have something to do with this.

Thanks
 
Hi:
Thanks for the information.

I think the problem is something other. Macro running fine if i given different path to save the file each time. However if i saved all files in one folder ( say folder name Test, after first run if i delete all the files in saved test folder and try to run the macro again, excel is automatically closing)

I have observed problem is happening at save as code not at active window.close.

Thanks
 
Hi:

Instead of closing the active window call the name of the workbook you want to close and close that workbook only.

Note:It is difficult to test your macro at my office PC.

Thanks
 
Back
Top