Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 118
Default WorkBook_Open Event Order

Hi

I have a spreadsheet which requires iterative calculation. I have written
code which gives the user the option to automatically enable iterative
calculation through selection of a series of message boxes (see below).

Private Sub Workbook_Open()
returnvalue2 = 7
Do While returnvalue2 = 7
returnvalue1 = MsgBox("Before using this sheet ensure that ITERATION
is switched on!" & Chr(13) & "Would you like this to be automatically
activated?", vbExclamation + vbYesNo, "Important")
If returnvalue1 = 6 Then
returnvalue2 = 0
Application.Iteration = True
Application.Calculation = xlCalculationAutomatic
Exit Do
Else
returnvalue2 = MsgBox("Not activating ITERATIVE CALCULATION will
cause the spreadsheet to give incorrect values." & Chr(13) & "Are you sure
you do not want to activate ITERATIVE CALCULATION?", vbCritical + vbYesNo,
"VERY IMPORTANT")
If returnvalue2 = 6 Then
Exit Do
End If
End If
Loop
End Sub

This works perfectly except that when the workbook is opened, the excel
circular reference warning comes up automatically if iterative calculation is
not active. And then excel help opens and things just get out of hand with
messageboxes popping up all over the place. What I'd like to do is interrupt
the workbook open event and allow my code to run before any built-in checks.
How do I do this?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default WorkBook_Open Event Order

Maybe you can use a "helper" workbook that changes the setting, then opens the
real workbook, and then closes itself.



BSc Chem Eng Rick wrote:

Hi

I have a spreadsheet which requires iterative calculation. I have written
code which gives the user the option to automatically enable iterative
calculation through selection of a series of message boxes (see below).

Private Sub Workbook_Open()
returnvalue2 = 7
Do While returnvalue2 = 7
returnvalue1 = MsgBox("Before using this sheet ensure that ITERATION
is switched on!" & Chr(13) & "Would you like this to be automatically
activated?", vbExclamation + vbYesNo, "Important")
If returnvalue1 = 6 Then
returnvalue2 = 0
Application.Iteration = True
Application.Calculation = xlCalculationAutomatic
Exit Do
Else
returnvalue2 = MsgBox("Not activating ITERATIVE CALCULATION will
cause the spreadsheet to give incorrect values." & Chr(13) & "Are you sure
you do not want to activate ITERATIVE CALCULATION?", vbCritical + vbYesNo,
"VERY IMPORTANT")
If returnvalue2 = 6 Then
Exit Do
End If
End If
Loop
End Sub

This works perfectly except that when the workbook is opened, the excel
circular reference warning comes up automatically if iterative calculation is
not active. And then excel help opens and things just get out of hand with
messageboxes popping up all over the place. What I'd like to do is interrupt
the workbook open event and allow my code to run before any built-in checks.
How do I do this?


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 118
Default WorkBook_Open Event Order

Thanks Dave

I had thought of implementing a "helper". the only problem is it generates
another file in the directory. On a network based system it is difficult to
communicate to everyone that may open the folder that the "helper" file is
not to be deleted and must be copied along with the master. I don't want to
hide the master file because firstly most people have "View Hidden Files or
Folders" active and people also tend to reuse spreadsheets for different
projects.

Is there a way to embed a workbook within another workbook i.e. two
worbooks, one excel file?

"Dave Peterson" wrote:

Maybe you can use a "helper" workbook that changes the setting, then opens the
real workbook, and then closes itself.



BSc Chem Eng Rick wrote:

Hi

I have a spreadsheet which requires iterative calculation. I have written
code which gives the user the option to automatically enable iterative
calculation through selection of a series of message boxes (see below).

Private Sub Workbook_Open()
returnvalue2 = 7
Do While returnvalue2 = 7
returnvalue1 = MsgBox("Before using this sheet ensure that ITERATION
is switched on!" & Chr(13) & "Would you like this to be automatically
activated?", vbExclamation + vbYesNo, "Important")
If returnvalue1 = 6 Then
returnvalue2 = 0
Application.Iteration = True
Application.Calculation = xlCalculationAutomatic
Exit Do
Else
returnvalue2 = MsgBox("Not activating ITERATIVE CALCULATION will
cause the spreadsheet to give incorrect values." & Chr(13) & "Are you sure
you do not want to activate ITERATIVE CALCULATION?", vbCritical + vbYesNo,
"VERY IMPORTANT")
If returnvalue2 = 6 Then
Exit Do
End If
End If
Loop
End Sub

This works perfectly except that when the workbook is opened, the excel
circular reference warning comes up automatically if iterative calculation is
not active. And then excel help opens and things just get out of hand with
messageboxes popping up all over the place. What I'd like to do is interrupt
the workbook open event and allow my code to run before any built-in checks.
How do I do this?


--

Dave Peterson

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default WorkBook_Open Event Order

Not that I know.

BSc Chem Eng Rick wrote:

Thanks Dave

I had thought of implementing a "helper". the only problem is it generates
another file in the directory. On a network based system it is difficult to
communicate to everyone that may open the folder that the "helper" file is
not to be deleted and must be copied along with the master. I don't want to
hide the master file because firstly most people have "View Hidden Files or
Folders" active and people also tend to reuse spreadsheets for different
projects.

Is there a way to embed a workbook within another workbook i.e. two
worbooks, one excel file?

"Dave Peterson" wrote:

Maybe you can use a "helper" workbook that changes the setting, then opens the
real workbook, and then closes itself.



BSc Chem Eng Rick wrote:

Hi

I have a spreadsheet which requires iterative calculation. I have written
code which gives the user the option to automatically enable iterative
calculation through selection of a series of message boxes (see below).

Private Sub Workbook_Open()
returnvalue2 = 7
Do While returnvalue2 = 7
returnvalue1 = MsgBox("Before using this sheet ensure that ITERATION
is switched on!" & Chr(13) & "Would you like this to be automatically
activated?", vbExclamation + vbYesNo, "Important")
If returnvalue1 = 6 Then
returnvalue2 = 0
Application.Iteration = True
Application.Calculation = xlCalculationAutomatic
Exit Do
Else
returnvalue2 = MsgBox("Not activating ITERATIVE CALCULATION will
cause the spreadsheet to give incorrect values." & Chr(13) & "Are you sure
you do not want to activate ITERATIVE CALCULATION?", vbCritical + vbYesNo,
"VERY IMPORTANT")
If returnvalue2 = 6 Then
Exit Do
End If
End If
Loop
End Sub

This works perfectly except that when the workbook is opened, the excel
circular reference warning comes up automatically if iterative calculation is
not active. And then excel help opens and things just get out of hand with
messageboxes popping up all over the place. What I'd like to do is interrupt
the workbook open event and allow my code to run before any built-in checks.
How do I do this?


--

Dave Peterson


--

Dave Peterson
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
Workbook_open Event Hassan Excel Programming 3 July 7th 08 12:37 PM
WORKBOOK_OPEN event DKS Excel Programming 6 September 22nd 06 10:40 PM
Workbook_Open() Event Bill Martin Excel Discussion (Misc queries) 9 January 13th 06 08:24 PM
Workbook_open Event Bruce Maston Excel Programming 6 April 6th 04 01:19 AM
OnTime event not firing in Workbook_Open event procedure GingerTommy Excel Programming 0 September 24th 03 03:18 PM


All times are GMT +1. The time now is 07:41 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"