Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
dan dan is offline
external usenet poster
 
Posts: 866
Default Uninstall Add-ins when workbook closes

I have a very simple macro I want to run each time I close a workbook. Its
purpose is to uninstall thee excel add-ins. But the macro is not running. I
put it in "ThisWorkbook" in my Personal macro workbook and cannot figure out
why it is not running. I can't even get the messagebox to appear. Any help
is greatly appreciated.

Private Sub Workbook_BeforeClose(cancel As Boolean)

i = MsgBox("TESTING", vbOKOnly, "TESTING")
Call Uninstall_Essbase_and_SmartView

End Sub

Sub Uninstall_Essbase_and_SmartView()

AddIns("Hyperion Essbase OLAP Server DLL (non-Unicode)").Installed = False
AddIns("Hyperion Essbase Query Designer Addin").Installed = False
AddIns("Hyperion Smart View for Office").Installed = False
End Sub


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,533
Default Uninstall Add-ins when workbook closes


"Dan" skrev i en meddelelse
...
I have a very simple macro I want to run each time I close a workbook. Its
purpose is to uninstall thee excel add-ins. But the macro is not running.
I
put it in "ThisWorkbook" in my Personal macro workbook and cannot figure
out
why it is not running. I can't even get the messagebox to appear. Any
help
is greatly appreciated.

Private Sub Workbook_BeforeClose(cancel As Boolean)

i = MsgBox("TESTING", vbOKOnly, "TESTING")
Call Uninstall_Essbase_and_SmartView

End Sub

Sub Uninstall_Essbase_and_SmartView()

AddIns("Hyperion Essbase OLAP Server DLL (non-Unicode)").Installed =
False
AddIns("Hyperion Essbase Query Designer Addin").Installed = False
AddIns("Hyperion Smart View for Office").Installed = False
End Sub




Hi

The macro will never run, where you have i now.

Put the "Workbook_BeforeClose" sub in "ThisWorkbook" in each workbook where
you want to trigger the uninstall sub.

The "Sub Uninstall...." can be in a module in your Personal macro workbook.

//Per


  #3   Report Post  
Posted to microsoft.public.excel.programming
dan dan is offline
external usenet poster
 
Posts: 866
Default Uninstall Add-ins when workbook closes

is there any way to put something out there that will run when all workbooks
are closed?



"Per Jessen" wrote:


"Dan" skrev i en meddelelse
...
I have a very simple macro I want to run each time I close a workbook. Its
purpose is to uninstall thee excel add-ins. But the macro is not running.
I
put it in "ThisWorkbook" in my Personal macro workbook and cannot figure
out
why it is not running. I can't even get the messagebox to appear. Any
help
is greatly appreciated.

Private Sub Workbook_BeforeClose(cancel As Boolean)

i = MsgBox("TESTING", vbOKOnly, "TESTING")
Call Uninstall_Essbase_and_SmartView

End Sub

Sub Uninstall_Essbase_and_SmartView()

AddIns("Hyperion Essbase OLAP Server DLL (non-Unicode)").Installed =
False
AddIns("Hyperion Essbase Query Designer Addin").Installed = False
AddIns("Hyperion Smart View for Office").Installed = False
End Sub




Hi

The macro will never run, where you have i now.

Put the "Workbook_BeforeClose" sub in "ThisWorkbook" in each workbook where
you want to trigger the uninstall sub.

The "Sub Uninstall...." can be in a module in your Personal macro workbook.

//Per



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,533
Default Uninstall Add-ins when workbook closes

Hi Dan

If you want to uninstall the add-ins when the last workbook is closed, put
this sub in all workbooks that will be open at the same time. The add-ins
will be uninstalled when only one workbook plus Personal.xls is still open,
but closing.

Private Sub Workbook_BeforeClose(Cancel As Boolean)
If Workbooks.Count = 2 Then ' Personal.xls count as open workbook
i = MsgBox("TESTING", vbOKOnly, "TESTING")
Call Uninstall_Essbase_and_SmartView
End If
End Sub
"Dan" skrev i en meddelelse
...
is there any way to put something out there that will run when all
workbooks
are closed?



"Per Jessen" wrote:


"Dan" skrev i en meddelelse
...
I have a very simple macro I want to run each time I close a workbook.
Its
purpose is to uninstall thee excel add-ins. But the macro is not
running.
I
put it in "ThisWorkbook" in my Personal macro workbook and cannot
figure
out
why it is not running. I can't even get the messagebox to appear. Any
help
is greatly appreciated.

Private Sub Workbook_BeforeClose(cancel As Boolean)

i = MsgBox("TESTING", vbOKOnly, "TESTING")
Call Uninstall_Essbase_and_SmartView

End Sub

Sub Uninstall_Essbase_and_SmartView()

AddIns("Hyperion Essbase OLAP Server DLL (non-Unicode)").Installed =
False
AddIns("Hyperion Essbase Query Designer Addin").Installed = False
AddIns("Hyperion Smart View for Office").Installed = False
End Sub




Hi

The macro will never run, where you have i now.

Put the "Workbook_BeforeClose" sub in "ThisWorkbook" in each workbook
where
you want to trigger the uninstall sub.

The "Sub Uninstall...." can be in a module in your Personal macro
workbook.

//Per





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
Deleting workbook closes Excel rac Excel Discussion (Misc queries) 0 December 31st 06 03:08 AM
Esc Key Closes Workbook MSweetG222 Excel Programming 1 April 15th 06 11:56 PM
run a macro before a workbook closes Jonathan Excel Programming 6 November 17th 05 04:02 PM
Workbook Unexpectedly Closes Immediately AD Excel Discussion (Misc queries) 0 January 31st 05 08:03 PM
protect add-in after workbook closes robvan Excel Programming 2 September 28th 04 11:42 PM


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