Graphic objects and Add-In problems

A

aramsey

Hello all,
I have a very wierd behavior problem.

I am writting an Add-In. Most of the time it works correctly, however
sometimes a user's computer will get into such a state that if my
Add-In is loaded, the Drawing and Graphics objects will stop working
correctly, even for spreadsheets that should not be interacting with my
Add-In.

My Add-In creates several functions to retrieve some data, handle menu
events, and catch sheet change events. It doesn't create or manipulate
any graphic or drawing object within Excel in any way.

I have a couple of spreadsheets that have some Text boxes from the
Excel Drawing menu with text in them, but no functions calls that my
Add-In would catch.

If my Add-In loads first, either automatically at startup or by
manually activating it in Tools|Add-Ins dialog, the spreadsheet will
not display the Text boxes correctly, borders will not render properly,
scrolling the spreadsheet will be incredibly slow, any graphics in the
Text Box will not draw properly or may dissappear altogether. The CPU
load also goes to 100% and stays there for several seconds. If I set
Tools|Options->[View]Objects=Hide all, then the scrolling and the rest
of the spreadsheet loads fine.

If, on the other hand, I load the spreadsheet first, and then manually
load the Add-In, the spreadsheet works fine.

I have added debug logging to try to debug this problem and Excel does
not appear to be even calling my Add-In functions while working within
the spreadsheet.

It is difficult to get Excel into this state, however once it IS in
this state, closing down Excel, or even killing its process will not
fix the problem. One must reboot Windows to fix it.

We see the problem in several versions of Windows (XP, 2000 & 98 have
been tried). We also see the problem in Excel 2000, and Excel XP. So
it doesn't appear to be Windows or Excel version specific.

To summarize:
1) The Spreadsheet has no functions which call the Add-In code.
2) If the Add-In loads first, I have problems.
3) If the spreadsheet with graphics loads first, it works fine.
4) If I turn off displaying the graphics the problem goes away but of
course so do my graphics.
5) Killing and restarting Excel doesn't fix the problem.
6) It appears that I am not having memory issues.

Could this be a bug in Excel's graphic library?

-alan
 
O

okaizawa

Hi,

you might have many objects in your sheet or temp folder.
try this:

Sub CountShapes()
Dim i As Long, sh As Object
Debug.Print String(40, "-")
Debug.Print "Workbook", "Sheet", "Shapes"
Debug.Print String(40, "-")
For i = 1 To ExecuteExcel4Macro("COLUMNS(DOCUMENTS(3))")
With Workbooks(ExecuteExcel4Macro("INDEX(DOCUMENTS(3)," & i & ")"))
For Each sh In .Sheets
Debug.Print .Name, sh.Name, sh.Shapes.Count
Next
End With
Next
End Sub

Sub TempFiles()
With CreateObject("Scripting.FileSystemObject").GetSpecialFolder(2)
MsgBox .Files.Count & " files in " & .Path
End With
End Sub

--
HTH,

okaizawa


Hello all,
I have a very wierd behavior problem.

I am writting an Add-In. Most of the time it works correctly, however
sometimes a user's computer will get into such a state that if my
Add-In is loaded, the Drawing and Graphics objects will stop working
correctly, even for spreadsheets that should not be interacting with my
Add-In.

My Add-In creates several functions to retrieve some data, handle menu
events, and catch sheet change events. It doesn't create or manipulate
any graphic or drawing object within Excel in any way.

I have a couple of spreadsheets that have some Text boxes from the
Excel Drawing menu with text in them, but no functions calls that my
Add-In would catch.

If my Add-In loads first, either automatically at startup or by
manually activating it in Tools|Add-Ins dialog, the spreadsheet will
not display the Text boxes correctly, borders will not render properly,
scrolling the spreadsheet will be incredibly slow, any graphics in the
Text Box will not draw properly or may dissappear altogether. The CPU
load also goes to 100% and stays there for several seconds. If I set
Tools|Options->[View]Objects=Hide all, then the scrolling and the rest
of the spreadsheet loads fine.

If, on the other hand, I load the spreadsheet first, and then manually
load the Add-In, the spreadsheet works fine.

I have added debug logging to try to debug this problem and Excel does
not appear to be even calling my Add-In functions while working within
the spreadsheet.

It is difficult to get Excel into this state, however once it IS in
this state, closing down Excel, or even killing its process will not
fix the problem. One must reboot Windows to fix it.

We see the problem in several versions of Windows (XP, 2000 & 98 have
been tried). We also see the problem in Excel 2000, and Excel XP. So
it doesn't appear to be Windows or Excel version specific.

To summarize:
1) The Spreadsheet has no functions which call the Add-In code.
2) If the Add-In loads first, I have problems.
3) If the spreadsheet with graphics loads first, it works fine.
4) If I turn off displaying the graphics the problem goes away but of
course so do my graphics.
5) Killing and restarting Excel doesn't fix the problem.
6) It appears that I am not having memory issues.

Could this be a bug in Excel's graphic library?

-alan
 
A

aramsey

I tried this macro and I only have a handful of objects, the larger of
the two spreadsheet I have has 16, the smaller has 8.
-alan
 
R

RichardT

I have add-ins with a very similar problem - (I have only looked at Office
2003).

In my case there are always 2 add-ins involved ("myaddin.xla" and
"another.xla"). and it seems to be linked to database connections:

If I just load "myaddin.xla", all the graphics in subsequently opened
worksheets are fine

If I load "myaddin.xla" and "another.xla" (any order) , the graphics are not
always shown in susequently opened worksheets

If I show a graphic first, and then load "myaddin.xla" and "another.xla",
everything works fine

The key issue is that "another.xla" perfoms database access. I have seen
this problem with three different "another.xla"
1) Is one I've written that uses ADO to connect to an Access database.
2) I have also heard that it happens when "another.xla" is a 3rd party
addin connecting to a proprietry database format.
3) Also happens with an add-in that uses DAO to read an Access database

I'd really like to know what's going wrong!

RichardT


Hello all,
I have a very wierd behavior problem.

I am writting an Add-In. Most of the time it works correctly, however
sometimes a user's computer will get into such a state that if my
Add-In is loaded, the Drawing and Graphics objects will stop working
correctly, even for spreadsheets that should not be interacting with my
Add-In.

My Add-In creates several functions to retrieve some data, handle menu
events, and catch sheet change events. It doesn't create or manipulate
any graphic or drawing object within Excel in any way.

I have a couple of spreadsheets that have some Text boxes from the
Excel Drawing menu with text in them, but no functions calls that my
Add-In would catch.

If my Add-In loads first, either automatically at startup or by
manually activating it in Tools|Add-Ins dialog, the spreadsheet will
not display the Text boxes correctly, borders will not render properly,
scrolling the spreadsheet will be incredibly slow, any graphics in the
Text Box will not draw properly or may dissappear altogether. The CPU
load also goes to 100% and stays there for several seconds. If I set
Tools|Options->[View]Objects=Hide all, then the scrolling and the rest
of the spreadsheet loads fine.

If, on the other hand, I load the spreadsheet first, and then manually
load the Add-In, the spreadsheet works fine.

I have added debug logging to try to debug this problem and Excel does
not appear to be even calling my Add-In functions while working within
the spreadsheet.

It is difficult to get Excel into this state, however once it IS in
this state, closing down Excel, or even killing its process will not
fix the problem. One must reboot Windows to fix it.

We see the problem in several versions of Windows (XP, 2000 & 98 have
been tried). We also see the problem in Excel 2000, and Excel XP. So
it doesn't appear to be Windows or Excel version specific.

To summarize:
1) The Spreadsheet has no functions which call the Add-In code.
2) If the Add-In loads first, I have problems.
3) If the spreadsheet with graphics loads first, it works fine.
4) If I turn off displaying the graphics the problem goes away but of
course so do my graphics.
5) Killing and restarting Excel doesn't fix the problem.
6) It appears that I am not having memory issues.

Could this be a bug in Excel's graphic library?

-alan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top