Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Addin Locking Excel

Indeed odd. A couple more long shots on the basis of unlikely but no harm to
try -

Instead of setting xlApp in the class initialization event, in the open
event -
Set evtEvents.xlApp = Excel.Application (xlapp would need to be public) or
use Set Property method.

Defer setting the application reference in the Open event with OnTime Now to
a macro in a normal module, ie to run when everything else has loaded.

When I close XL I am prompted to my changes to Book1 which I have
not touched or modified in any way (odd


One thing that might cause that is a change in certain application level
settings, eg events (sometimes but not always changes the saved property),
calculation etc. Not that there's anything in your code that appears to do
that but perhaps a setting is being changed by something else (and perhaps
failing with certain settings due to no visible workbook during startup).

Regards,
Peter T

"Jim Thomlinson" wrote in message
...
I have an addin that uses app level events to catch the before print

event.
It installs and works great on a number of computers including my own. On

one
machine however it causes XL to freeze up. Here are the symptoms:

I open Excel and install the addin. At this point it functions correctly

and
there are no errors generated at any point. When I close XL I am prompted

to
save my changes to Book1 which I have not touched or modified in any way

(odd
but I choose not to save the cahnges). When I go to re-open XL no workbook
opens up and all menus are frozen. If I go in and initiate the code in the
addin and then stop the code then XL unfreezes and a new workbook opens

up.

The system that I am installing on is similar to my own:
XL 2002 with SP3
Essbase Installed
CubeAnalysis Installed

Anyone seen anything like this before???

Here is the code...

Class**************
Option Explicit
Private WithEvents xlApp As Excel.Application

Private Sub Class_Initialize()
Set xlApp = Excel.Application
End Sub

Private Sub xlApp_WorkbookBeforePrint(ByVal Wb As Workbook, Cancel As

Boolean)
On Error Resume Next
If ActiveSheet.CodeName = "shtKPIrpt" Then
Wb.Sheets("open").Range("B23").Value = CInt(Mid(Wb.Path, 6, 4))
End If
End Sub

Thisworkbook************
Option Explicit

Private Sub Workbook_Open()
'MsgBox "Test1"
Set evtEvents = New clsXLEvents
'MsgBox "Test2" 'This showed up on re-open after install
End Sub

Standard Code Module**********
Option Explicit

Public evtEvents As clsXLEvents

--
TIA...

Jim Thomlinson



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
Addin Locking Excel Simon Murphy Excel Programming 0 January 13th 07 04:30 AM
locking formula in cells in without locking whole sheet SuziQ Excel Discussion (Misc queries) 1 July 21st 06 03:58 PM
Unshimmed Automation Addin and Shimmed COM Addin in same App Domai Brandon Excel Programming 0 June 27th 06 11:18 PM
How to display the user "locking" a workbook or an addin. Stefano Gatto Excel Programming 1 June 2nd 06 09:05 AM
Remove Excel AddIn from AddIn List !! Help carl Excel Programming 2 December 8th 03 03:36 PM


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