VBA code to run another password-ed VBA code - vba

I have a VBA macro, developed by a third party, and which is password-protected. When the macro finishes what is is supposed to do, it shows a message box, and to continue beyond that the user needs to click a button. Before the button is clicked, you cannot do anything else .
I need to run that macro on several files. Is there a way to bypass the message box, and just call another instance of the macro, on a different file...?

Related

How do I make a userform appear on demand in Microsoft Word?

I can make it popup on opening the document, but what if I close the userform and want to it to show up again in the same document? I know in excel you can add a button onto a worksheet directly and make it show the userform on click, but this button is unavailable for microsoft Word. Is there a solution besides initiating the script by hand?
To display a VBA userform, you can trigger it from a macrobutton field, from a form field, from a shape, from a QAT button or from an ActiveX button. There are probably a couple of other methods I'm not remembering at the moment. Each is a little different in the exact steps, but all will run the command:
UserFormName.Show

Excel 2013 VBA not running for specific user in specific file

We have a spreadsheet with some VBA in it that compiles data from multiple tabs to generate a score and pull over comments.
I am the only user who cannot run the macro. When I try to run the macro, either via the macro button or directly from the macro window, nothing happens. This issue is specific to this single file, as I'm working all the time with macro-enabled workbooks. So the problem isn't tied to my Trust Center settings.
My only smoking gun is that most of the code sits in the "ThisWorkbook" Excel Object. If I try to move some of the code to a module, then I can run it, although I get an error since the code was designed to sit in ThisWorkbook.
Any idea why I would be the only person who can't run this macro? Also, I've disabled all add-ins, so I don't think that's the issue.

Pause VBA Macro to allow manual input of data

I have an Excel workbook macro that opens another workbook and starts copying data into it and formatting it. At one point in the process, I want the macro to pause and let the user manually enter data into the target workbook and then resume processing.
MsgBox, Application.Wait(), and Sleep are all application modal and will not let the user update anything in the other workbook while they are executing.
I found this while searching for a solution. It gets me halfway there in that I can manipulate the other sheet but only with my mouse. No keyboard presses get sent to the workbook.
Any ideas on getting all the way there?
I was thinking that I could just have two macros. The user would run one, then perform his manual tasks, then run the other. This appears to work but I would have to convert everything to globals so hopefully, someone has a better idea.
Thanks!
Depending on the macro being run to copy and paste, is the main concern with user intervention during execution of the macro getting the active cell/sheet (if being used) back to being active after the user manipulates something.
I'd recommend storing the active cell/sheet address in a variable prior to the Application.Wait() and then setting the active cell to that stored value on resume.
Without a posting of what your macro is doing though, it is hard to know if this suggestion helps your current situation.

Restrict User Interface in Excel while macro is running

I have 4-5 workbooks open and one workbook has macro written for copying of data from other workbooks.
But if a user is working on some other workbook while the macro is running, excel freezes and goes into not responding mode.
How do I disable user interface in this case for all workbooks till macro completes it's coding?
Display a "modal" userform while the macro runs. Users are unable to interact with Excel while the form is displayed.
It could be as simple as having just a label on the form saying "Please wait while macro runs". If the macro takes more than a few seconds to run, you could display a progress bar.
You will probably need to use the QueryClose event to stop the user clicking the close button in the top right corner of the form.

How to pause code using userform

so basically I need to pause the macro code, wait for user input and then continue the rest of the code. I know that by using the "modeless userform", this can be done.
But the point now is that all the code after the userform popped up needed to written in the command button part (basically it is the userform own module). And because of that, all the initialization, all the variables that I still need has been wiped off.
So I am asking is there a way to pause in the middle of a vba code then, wait for user input, then continue the rest of the code
Thank you very much for your help
What do you mean as "user input"?
Standard input methods as MsgBox, InputBox or modal user forms do what you are asking;
"code after the userform popped up needed to"...
Instead of closing a form, hide it. Code continues and form data
still available;
Now, if you mean by "user input", manipulating workbook, you must go on events:
Example: Create a before user input macro and then place remaining code in a Worksheet_Change event.