MS Office Forum

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds

Automatic Open, Run, and Close

  Asked By: Magenta    Date: Mar 04    Category: MS Office    Views: 1412

I want to place an icon on my desktop. When I click on it, I want it
to open Excel 2003, run a specific macro (which does a printing related
task), and then close Excel.

I only want the above to happen when I click on that particular icon.
I don't want the above to happen simply whenever I open Excel.

I thought about adding the macro to the Excel start directory, but then
the marco would run evey time I opened Excel.

Any ideas regarding how to set up this icon?



2 Answers Found

Answer #1    Answered By: Doyle Gonzalez     Answered On: Mar 04

Just make the code part of the open  event for the workbook.

Answer #2    Answered By: Balbir Kaur     Answered On: Mar 04

Enter VB editor and In the Workbook place  a macro as below.

Private Sub Workbook_Open()
Call YourMAcro
ThisWorkbook.Close False
End Sub

Didn't find what you were looking for? Find more on Automatic Open, Run, and Close Or get search suggestion and latest updates.