Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default User function and Open Event

I have this code:

Private Sub Workbook_Open()
startmodel
End Sub

In Excel 97 this do not working! In 2003 this works perfect... After
debugging I find strange thing... Into workbook I use user function
for dividing...:

Function div0(a, b) As Double
Dim result As Double
If b = 0 Then
result = 0
Else
result = a / b
End If
div0 = result
End Function


If I set " Manual Calc" all is OK (after loading workbook "starmodel"
executes perfekt)?! But if calculating is automatic when book loads
"startmodel" not starting? How to resolve this problem into Excel97
without setting Manual Calculating?

TIA

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 923
Default User function and Open Event

Are you saying that the open workbook event is not working or that your
function is not working?

What does your 'startmodel' procedure do, maybe this is where the problem
lies?

Cheers
Nigel

"Yuriy" wrote in message
...
I have this code:

Private Sub Workbook_Open()
startmodel
End Sub

In Excel 97 this do not working! In 2003 this works perfect... After
debugging I find strange thing... Into workbook I use user function
for dividing...:

Function div0(a, b) As Double
Dim result As Double
If b = 0 Then
result = 0
Else
result = a / b
End If
div0 = result
End Function


If I set " Manual Calc" all is OK (after loading workbook "starmodel"
executes perfekt)?! But if calculating is automatic when book loads
"startmodel" not starting? How to resolve this problem into Excel97
without setting Manual Calculating?

TIA



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default User function and Open Event

Worksheet_Open not working:(
Thos not working too (in Excel97!) Same result (no result)

Private Sub Workbook_Open()
Msgbox("blah")
End Sub

I make thos to work with this code, but I think that is stupid to make
such things:) Somebody have this strange problem?! Where is mistake
and how to find a problem... Strange that into Excel2003 allright,
into '97 no:)

This is workin code (looks strange for me):


Private Sub Workbook_Open()
startmodel
Application.Calculate
Application.Calculation = xlCalculationAutomatic
End Sub

Private Sub Workbook_BeforeClose(Cancel As Boolean)
endmodel
Application.Calculation = xlCalculationManual
End Sub



TIA



On Wed, 7 Jul 2004 11:44:09 +0100, "Nigel"
wrote:

Are you saying that the open workbook event is not working or that your
function is not working?

What does your 'startmodel' procedure do, maybe this is where the problem
lies?

Cheers
Nigel

"Yuriy" wrote in message
.. .
I have this code:

Private Sub Workbook_Open()
startmodel
End Sub

In Excel 97 this do not working! In 2003 this works perfect... After
debugging I find strange thing... Into workbook I use user function
for dividing...:

Function div0(a, b) As Double
Dim result As Double
If b = 0 Then
result = 0
Else
result = a / b
End If
div0 = result
End Function


If I set " Manual Calc" all is OK (after loading workbook "starmodel"
executes perfekt)?! But if calculating is automatic when book loads
"startmodel" not starting? How to resolve this problem into Excel97
without setting Manual Calculating?

TIA



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
What code do I use to attach event handler that will open my user. TeresaManley Excel Worksheet Functions 2 May 5th 07 09:55 PM
How can I expose the TextBox BeforeUpdate event to my user class? bereid Excel Discussion (Misc queries) 0 November 30th 05 05:00 PM
Save Event - Determine if called by code or user David Sedberry Excel Programming 0 October 2nd 03 04:56 PM
user event driven macro issue Jean-Paul Viel Excel Programming 0 September 18th 03 05:32 PM
user event driven macro issue steve Excel Programming 0 September 18th 03 05:00 PM


All times are GMT +1. The time now is 10:07 AM.

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"