From: LunaMoon on
Hi all,

I would like to have the following run every time when the Excel 2003
sheet is opened:

so I am going to put the VBA macro into AUTO_RUN function...

Now when the Excel 2003 file is opened,

I need the following:

1. refresh/recalculate all the sheets in the Excel 2003 file;
2. save all the sheets;
3. close out the file.

Please help me translate these into VBA/MACRO... thanks a lot!
From: Gord Dibben on
Excel has no AUTO_RUN function.

Did you mean Auto_Open?

I would put this code into Thisworkbook Module.

Private Sub Workbook_Open()
Application.Calculate
With ThisWorkbook
.Save
.Close
End With
End Sub

But note...............you will have to disable events if you ever want to
keep the workbook open for editing.


Gord Dibben MS Excel MVP

On Tue, 4 May 2010 12:13:34 -0700 (PDT), LunaMoon <lunamoonmoon(a)gmail.com>
wrote:

>Hi all,
>
>I would like to have the following run every time when the Excel 2003
>sheet is opened:
>
>so I am going to put the VBA macro into AUTO_RUN function...
>
>Now when the Excel 2003 file is opened,
>
>I need the following:
>
>1. refresh/recalculate all the sheets in the Excel 2003 file;
>2. save all the sheets;
>3. close out the file.
>
>Please help me translate these into VBA/MACRO... thanks a lot!

 | 
Pages: 1
Prev: sorting
Next: Pivot Table Calculated Field