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

Running Macro (with Excel minimised in background - not active)

Shobhit Mehta

New Member
Running Macro (with Excel minimised in background - not active)

Dear All,

Background : I have created an Excel Macro to take a screenshot of the screen and align those screenshots vertically one below the other.

I also assigned a keyboard shortcut 'Ctrl+D' to button to perform the above task.

Requirement : I need to run the Macro even if the Excel is completely mininised or running in the background (not active) so that when I take the screenshot, Excel wouldn't come anywhere in the screenprint. This should also work even if I am active in some other application.

To sum-up : run the Macro even if the Excel is not active on pressing the keyboard shortcut assigned to Macro (keyboard shortcut can be changed)

Please let me know if the above isn't clear and you need any further information.

P.S. - sample file attached in the thread

Many thanks in advance.

-Shobhit Mehta
 

Attachments

  • PrintArea.xlsm
    18.6 KB · Views: 15
Hi:

Find the attached.

Note: Minimize the excel work book no the excel application, the code will automatically minimize the excel application.Click-on your excel Icon on your task bar to get your input box, enter your parameter and click ok.

Thanks
 

Attachments

  • PrintArea.xlsm
    424.1 KB · Views: 19
Thanks very much!

But how can I run it multiple times? Do I have to go to Excel and minimise the worksheet everytime I want to run the Macro?

Can we do something like:

  1. Minimise the workbook (as you advised in the above answer)
  2. Press a keyboard shortcut and run the macro
  3. Enter the input in dialog box, get the print in the workbook
  4. Maximise the workbook whenever we want to stop the macro
Kindly advise?
 
Hi Nebu,

Is it just me who is facing issues while running the Macro when multiple excels are open?

Can you please advise?

Thanks,
Shobhit
 

Attachments

  • Capture.JPG
    Capture.JPG
    18.7 KB · Views: 12
Hi:

I would recommend you to open the macro workbook in a separate window. Since the macro is triggered by window re-size if you try to open all the excel workbooks in same instance it may trigger an error.

Thanks
 
Hello Nebu.

When I run the workbook you shared using CTRL + F9 it works. But when I copied the code in a separate excel module and tried to run it. It wont work. May I know how did you do it please?
 
Back
Top