ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Event to call before a opened workbook is recalculated (https://www.excelbanter.com/excel-programming/319127-event-call-before-opened-workbook-recalculated.html)

Torben Laursen[_2_]

Event to call before a opened workbook is recalculated
 
Hi

I have a add-in that defines a number of functions. When a user uses them
and saves a workbook When the user loads the workbook again I need to be
able to write some information to a dll before Excel recalculate the sheet.
At the moment the code is in the event WorkbookOpen but that is to late.

Can anyone tell me if there is a event that I can call before any
calculations are done?

Thanks Torben Laursen



Frank Kabel

Event to call before a opened workbook is recalculated
 
Hi
AFAIK the workbook open event is the first event which is called

--
Regards
Frank Kabel
Frankfurt, Germany
"Torben Laursen" schrieb im Newsbeitrag
...
Hi

I have a add-in that defines a number of functions. When a user uses them
and saves a workbook When the user loads the workbook again I need to be
able to write some information to a dll before Excel recalculate the
sheet. At the moment the code is in the event WorkbookOpen but that is to
late.

Can anyone tell me if there is a event that I can call before any
calculations are done?

Thanks Torben Laursen




Torben Laursen[_2_]

Event to call before a opened workbook is recalculated
 
Hi Frank

Thanks
But my userdefined functions are called before the workbookopen event.
Is there a way so I can execute some code before they are called?

Thanks Torben Laursen


"Frank Kabel" wrote in message
...
Hi
AFAIK the workbook open event is the first event which is called

--
Regards
Frank Kabel
Frankfurt, Germany
"Torben Laursen" schrieb im Newsbeitrag
...
Hi

I have a add-in that defines a number of functions. When a user uses them
and saves a workbook When the user loads the workbook again I need to be
able to write some information to a dll before Excel recalculate the
sheet. At the moment the code is in the event WorkbookOpen but that is to
late.

Can anyone tell me if there is a event that I can call before any
calculations are done?

Thanks Torben Laursen






Jim Thomlinson[_3_]

Event to call before a opened workbook is recalculated
 
You can try this. It is a excel file that opens another excel file in a
seperate instance of Excel. You can fire whatever you want from here before
the workbok ever opens...

Option Explicit
Private Const m_strPath As String = "C:\Documents and
Settings\jamest\Desktop\Budget 2004\"
Private Const m_strFileName As String = "TestTemplate.xls"


Sub Auto_Open()
Dim appXL As Excel.Application
Dim wbk As Workbook

Set appXL = CreateObject("Excel.Application.9")
appXL.Visible = True
Set wbk = appXL.Workbooks.Open(m_strPath & m_strFileName)
wbk.RunAutoMacros xlAutoOpen
ThisWorkbook.Close SaveChanges:=False
End Sub

"Torben Laursen" wrote:

Hi Frank

Thanks
But my userdefined functions are called before the workbookopen event.
Is there a way so I can execute some code before they are called?

Thanks Torben Laursen


"Frank Kabel" wrote in message
...
Hi
AFAIK the workbook open event is the first event which is called

--
Regards
Frank Kabel
Frankfurt, Germany
"Torben Laursen" schrieb im Newsbeitrag
...
Hi

I have a add-in that defines a number of functions. When a user uses them
and saves a workbook When the user loads the workbook again I need to be
able to write some information to a dll before Excel recalculate the
sheet. At the moment the code is in the event WorkbookOpen but that is to
late.

Can anyone tell me if there is a event that I can call before any
calculations are done?

Thanks Torben Laursen







Charles Williams

Event to call before a opened workbook is recalculated
 
You could either switch to manual before the workbook is opened, or
(probably safer) have a global switch which causes your UDFs to do nothing
unless the information has been written to the dll and then recalculate once
you have written the information to the dll.

Charles
______________________
Decision Models
FastExcel 2.1 now available
www.DecisionModels.com

"Torben Laursen" wrote in message
...
Hi Frank

Thanks
But my userdefined functions are called before the workbookopen event.
Is there a way so I can execute some code before they are called?

Thanks Torben Laursen


"Frank Kabel" wrote in message
...
Hi
AFAIK the workbook open event is the first event which is called

--
Regards
Frank Kabel
Frankfurt, Germany
"Torben Laursen" schrieb im Newsbeitrag
...
Hi

I have a add-in that defines a number of functions. When a user uses
them and saves a workbook When the user loads the workbook again I need
to be able to write some information to a dll before Excel recalculate
the sheet. At the moment the code is in the event WorkbookOpen but that
is to late.

Can anyone tell me if there is a event that I can call before any
calculations are done?

Thanks Torben Laursen









All times are GMT +1. The time now is 03:35 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com