• 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.

DISABLE MACROS ON A PARTICULAR FILE

VDS

Member
Dear Colleagues,

I am trying to open the file named "M:\Old\Total Data of projects" as per the attached screenshot. The file gives the security warning message of Macro "Disable / Enable / More info". Once it is enabled, file is open and takes so much time to activate. Is it possible to disable macro on this particular file whenever it is opened ? Just like in other programming applications like On load, On Open, On close, etc.


VDS
 

Attachments

  • upload_2013-11-25_18-1-50.png
    upload_2013-11-25_18-1-50.png
    35.3 KB · Views: 2
Hi, VDS!
Tried holding pressed Shift key when opening the file?
Otherwise put a message box with Yes/No at top of the workbook open event code.
Regards!
 
Sir,

I am not able to disable macro while holding the shift key. I came to know the below function can be helpful.

Sub MACRO_DO_SOMETHING()

Application.EnableEvents = False

Workbooks.Open FILENAME:="FILE_NAME.xls" PASSWORD:="XYZ"
RUN_OPERATION
Workbooks("FILE_NAME.xls").Close SaveChanges:=False

Application.EnableEvents = True
End Sub

However, this can function be worked only on a macro enabled worksheet.

As stated above, my particular file can open quickly if macros are disabled.

Could u please suggest any solution.


VDS
 
@ Abhijeet Sir,

This is already in medium. Is there any other way to extract complete vb code from the file. I am unable to attach the file. If the VBA code has been deleted from the file, it will open quickly. But the entire function from Personal.XLS will be washed out creating little bit of hectic.

Could you please sort out.

VDS
 
Hi, VDS!
Give a look at the uploaded file. If you press and keep the Shift key until the workbook is opened macros do not run and no message box is displayed.
Regards!
 

Attachments

  • DISABLE MACROS ON A PARTICULAR FILE (for VDS at chandoo.org).xlsm
    12 KB · Views: 1
Back
Top