Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 157
Default Execution on opening the workbook.

Hi,

Im few hours old with VBA.

I have a workbook in which I have a sheet by the name "Report Data" . In the
cell A3 of this sheet I want the person who saves this worksheet to indicate
the date for which the data in rest of the worksheets is current. It might
happen that the person who worked on this sheet didnt update the date and
the sheet got saved with the date of last save.

To prevent the same I want a macro which will execute automatically on
opening the workbook. This macro will clear the contents in cell A3.

I have already got another macro ( written by someone for me)
Workbook_BeforeSave which does some other things. Im thinking that once the
A3 cell can be made automatically blank then in Beforesave function I will
check for whether cell A3 is blank and hence not save the file. This will
flag the person who updates the workbook to enter the correct date in A3

I searched the MS Visual basic help for a function like AfterOpen but
couldnt find what Im looking for ..

Please guide me.

Regards,
Hari
India


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Execution on opening the workbook.

Hi
use Workbook_Open()
in the same module as your current BeforeSave macro is.
For more about these event procedures see:
http://www.cpearson.com/excel/events.htm

--
Regards
Frank Kabel
Frankfurt, Germany


Hari wrote:
Hi,

Im few hours old with VBA.

I have a workbook in which I have a sheet by the name "Report Data" .
In the cell A3 of this sheet I want the person who saves this
worksheet to indicate the date for which the data in rest of the
worksheets is current. It might happen that the person who worked on
this sheet didnt update the date and the sheet got saved with the
date of last save.

To prevent the same I want a macro which will execute automatically

on
opening the workbook. This macro will clear the contents in cell A3.

I have already got another macro ( written by someone for me)
Workbook_BeforeSave which does some other things. Im thinking that
once the A3 cell can be made automatically blank then in Beforesave
function I will check for whether cell A3 is blank and hence not save
the file. This will flag the person who updates the workbook to enter
the correct date in A3

I searched the MS Visual basic help for a function like AfterOpen but
couldnt find what Im looking for ..

Please guide me.

Regards,
Hari
India


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 157
Default Execution on opening the workbook.

Frank that was a Formula rank one method.

Im able to do what I wanted.

Thanx a ton for helping day in and night out.

Regards,
Hari
India






"Frank Kabel" wrote in message
...
Hi
use Workbook_Open()
in the same module as your current BeforeSave macro is.
For more about these event procedures see:
http://www.cpearson.com/excel/events.htm

--
Regards
Frank Kabel
Frankfurt, Germany


Hari wrote:
Hi,

Im few hours old with VBA.

I have a workbook in which I have a sheet by the name "Report Data" .
In the cell A3 of this sheet I want the person who saves this
worksheet to indicate the date for which the data in rest of the
worksheets is current. It might happen that the person who worked on
this sheet didnt update the date and the sheet got saved with the
date of last save.

To prevent the same I want a macro which will execute automatically

on
opening the workbook. This macro will clear the contents in cell A3.

I have already got another macro ( written by someone for me)
Workbook_BeforeSave which does some other things. Im thinking that
once the A3 cell can be made automatically blank then in Beforesave
function I will check for whether cell A3 is blank and hence not save
the file. This will flag the person who updates the workbook to enter
the correct date in A3

I searched the MS Visual basic help for a function like AfterOpen but
couldnt find what Im looking for ..

Please guide me.

Regards,
Hari
India




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 157
Default Execution on opening the workbook.

Hi Frank

Facing a Strange issue now.

I used the open code and before save code in conjunction and im able to make
sure that user doesnt enter data s/he isnt supposed to do. Also, Im able to
prevent the user from skipping/missing cells which are to be populated.

But Suppose I have some cells unfilled and/or some cells having incorrect
data and I choose the option "Send to Mail receipient as attachment" then
excel saves the incorrect/incomplete as a temporary file and attaches it to
my Lotus.

Please tell me whether there is a workaround to this and also why excel
allows it to send such a file as an attachement.

Regards,
Hari
India

"Hari" wrote in message
...
Frank that was a Formula rank one method.

Im able to do what I wanted.

Thanx a ton for helping day in and night out.

Regards,
Hari
India






"Frank Kabel" wrote in message
...
Hi
use Workbook_Open()
in the same module as your current BeforeSave macro is.
For more about these event procedures see:
http://www.cpearson.com/excel/events.htm

--
Regards
Frank Kabel
Frankfurt, Germany


Hari wrote:
Hi,

Im few hours old with VBA.

I have a workbook in which I have a sheet by the name "Report Data" .
In the cell A3 of this sheet I want the person who saves this
worksheet to indicate the date for which the data in rest of the
worksheets is current. It might happen that the person who worked on
this sheet didnt update the date and the sheet got saved with the
date of last save.

To prevent the same I want a macro which will execute automatically

on
opening the workbook. This macro will clear the contents in cell A3.

I have already got another macro ( written by someone for me)
Workbook_BeforeSave which does some other things. Im thinking that
once the A3 cell can be made automatically blank then in Beforesave
function I will check for whether cell A3 is blank and hence not save
the file. This will flag the person who updates the workbook to enter
the correct date in A3

I searched the MS Visual basic help for a function like AfterOpen but
couldnt find what Im looking for ..

Please guide me.

Regards,
Hari
India






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I stop blank workbook from opening when opening an existing kjg Excel Discussion (Misc queries) 3 February 12th 10 09:36 PM
How to ged rid of the "Execution Error 9" message at the file opening? frenchbox Excel Discussion (Misc queries) 0 July 31st 06 03:28 PM
Disable VBA code execution when loading a workbook Charles Excel Discussion (Misc queries) 4 October 14th 05 09:12 PM
How to make the opening of a workbook conditional upon the opening of another workbook Marcello do Guzman Excel Programming 1 December 16th 03 06:09 AM
How to make opening of workbook conditional of opening of another workbook turk5555[_2_] Excel Programming 2 December 15th 03 11:07 PM


All times are GMT +1. The time now is 04:39 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"