🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: microsoft.public.office.developer.automation
2 messages
2 total messages Started by Roland Leisch Tue, 08 Mar 2005 10:15
Problem with Zoom and Windows count in Excel 2002
#19
Author: Roland Leisch
Date: Tue, 08 Mar 2005 10:15
33 lines
2862 bytes
Hello!

I have posted the problem before but there were some misunderstanding so
I will post again:

I have an application which uses an ole container to display an excel
workbook. In my application I have a menubar in which I can change Zoom
settings for the contained workbook (since I prohibited any interaction
on the workbook itself as I want it only to be displayed and not be
changed in any way).

If I start my application I can change the zoom settings without any
problems.

But if a start my application a second time (with an other workbook) Im
not able to change any settings in the first workbook instead I get the 
following error: COM object method returns error code: 0x80020009; 
DISP_E_EXCEPTION where I want to set the new Zoomfactor ( I found out, 
that Windows.Count is zero and I assume that this is the cause of the 
problem).

So I tried to implement a workaround: I add custom document properties
which allow me to identify the open workbooks. I iterate all workbooks
and if I find the right workbook I call workbook.activate(lcid).

The very strange thing is that this works only if one instance of my
application is open - if a second instance is running I get: COM object
method returns error code: 0x800A03EC and only the last started instance
reacts - the first instance gives me the 0x800A03EC error.

Has anybody here got an idea where the problem could be?

Thanks in advance!
Re: Problem with Zoom and Windows count in Excel 2002 - SOLVED!
#1
Author: Roland Leisch
Date: Thu, 10 Mar 2005 13:21
39 lines
3320 bytes
Roland Leisch wrote:
> Hello!
> 
> I have posted the problem before but there were some misunderstanding so
> I will post again:
> 
> I have an application which uses an ole container to display an excel
> workbook. In my application I have a menubar in which I can change Zoom
> settings for the contained workbook (since I prohibited any interaction
> on the workbook itself as I want it only to be displayed and not be
> changed in any way).
> 
> If I start my application I can change the zoom settings without any
> problems.
> 
> But if a start my application a second time (with an other workbook) Im
> not able to change any settings in the first workbook instead I get the 
> following error: COM object method returns error code: 0x80020009; 
> DISP_E_EXCEPTION where I want to set the new Zoomfactor ( I found out, 
> that Windows.Count is zero and I assume that this is the cause of the 
> problem).
> 
> So I tried to implement a workaround: I add custom document properties
> which allow me to identify the open workbooks. I iterate all workbooks
> and if I find the right workbook I call workbook.activate(lcid).
> 
> The very strange thing is that this works only if one instance of my
> application is open - if a second instance is running I get: COM object
> method returns error code: 0x800A03EC and only the last started instance
> reacts - the first instance gives me the 0x800A03EC error.
> 
> Has anybody here got an idea where the problem could be?
> 
> Thanks in advance!

I found a workaround and until now it works:

Whenever I want to activate a file in an ole container I call 
OleContainer.doVerb(SHOW) and everything is fine!
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads