0

Does anyone know if it is possible to run a macro embedded inside a workbook which has a password enabled?

Basically I am able to run a macro in a workbook already - However in my manager wants a freaking password added and I don't think thats possible

Has anyone managed to get this in place?

4
  • 1
    Where do you want the password added? Upon running of the macro? Or does the workbook have a password? Commented Nov 24, 2009 at 17:06
  • The workbook has a macro Commented Nov 24, 2009 at 17:31
  • Yes, I realize the workbook has a macro, but where should/does the password live? Commented Nov 24, 2009 at 17:58
  • Sorry the workbook has a password - Thats what I meant. Commented Nov 24, 2009 at 17:58

2 Answers 2

1

Are you trying to open the workbook in code and then run the macro?

The open method on the workbook object accepts a password as a parameter.

Sign up to request clarification or add additional context in comments.

Comments

0

As mentioned, the Open method can be passed a password. However it's worth noting that hard-coded passwords are pretty trivial to extract from an exe. IMHO it's better to just catch the exception to the open method, prompt the user for the password, and then retry the open method with the provided password.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.