Automatically Save after Dynamic recalculation / updation

arshadmohamed

New Member
Joined
Jan 18, 2005
Messages
18
Iam using a Powerpoint presentation linked to a Excel work sheet to be updated daily..

The excel worksheet is made to open at Windows startup and it updates itself after comparing the sytem date accordingly..

Is there any way i can automatically save this excel file and close after the dynamic updation ?

How to create or add the any Macro only for this particular file?

Thanx for any help :)
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
At the end of procedure that carries out the updation add the line:

ActiveWorkbook.Close SaveChanges:=True
 
Upvote 0
Re: Automatically Save after Dynamic recalculation / updatio

Wel,

Where to add this command?

The updation i do, is kind of function comparing the local date, for which i use IF Today()

Do i have to create a Macro and add the above said comman?

How to Create a Macro which would apply only for this file alone?

sorry if iam not very clear..
 
Upvote 0
Re: Automatically Save after Dynamic recalculation / updatio

okay, if the workbook does not have any code, do this:

To the left of the File menu, there is a small excel icon. Right click on the icon and choose `view code'. You will be taken to VBE-visual Basic Editor. In the top of the large white area, there will be two drop-down boxes. In the left han box choose `workbook'. You will be presented with two lines `Private Sub Workbook_Open' and End Sub. In between the lines, paste this code:

Code:
Private Sub Workbook_Open() ' Do not paste this line
    Dim response
    response = MsgBox("Save Changes and Close?", vbOKCancel)
    If response = vbCancel Then Exit Sub
    ActiveWorkbook.Close savechanges:=True
End Sub 'Don't paste this either

Now whenever the workbook is opened the user will be given an option to save and close the workbook
 
Upvote 0
Re: Automatically Save after Dynamic recalculation / updatio

Thanx for the help..

It is prompting for Saving changes rite?

it does not requre for the file to be open.. coz its the Power Point Window dats gonna run..

Is it possible to make the file just close by itself? without any option ?
 
Upvote 0
Re: Automatically Save after Dynamic recalculation / updatio

Yes, by this code:

Code:
Private Sub Workbook_Open()     
        ActiveWorkbook.Close savechanges:=True 
End Sub

After this, if you need to use the workbook, macros have to be disabled.
 
Upvote 0

Forum statistics

Threads
1,214,918
Messages
6,122,249
Members
449,075
Latest member
staticfluids

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top