OLE Error happens when Sheet activate

Add-in Express™ Support Service
That's what is more important than anything else

OLE Error happens when Sheet activate
 
Subscribe
Zewus Choe




Posts: 10
Joined: 2024-05-16
When in the fore-ground in Excel Application, sheet active or range select functions do not happens errors.

but when in the back-ground in Excel Application, OLE Error happens.

I call these functions as follows.

_Worksheet(⋯).Activate(0);
ExcelRange(⋯).Select;

How can I avoid errors.
Posted 16 May, 2024 09:10:59 Top
Andrei Smolin


Add-in Express team


Posts: 19011
Joined: 2006-05-11
Hello Zewus,

I don't understand the context. Are you talking about a COM add-in? How do you set Excel background or foreground? How do you invoke the method producing the issue? Can I have such a method for studying? What code lines in that method produce errors? What are the errors?

Regards from Poland (GMT+2),

Andrei Smolin
Add-in Express Team Leader
Posted 16 May, 2024 18:07:13 Top
Zewus Choe




Posts: 10
Joined: 2024-05-16
Hello

I'm also talking about COM add-in.

My COM add-in function changes the value to other sheet or cells in addition to the cell where the function was entered.

These functions are called to select cells to output values.

However, the OLE error occurs when these functions(.Activate or .Select) are called in the Excel.exe in the background.
Posted 16 May, 2024 22:32:56 Top
Andrei Smolin


Add-in Express team


Posts: 19011
Joined: 2006-05-11
Hello Zewus,

This isn't a COM add-in as COM add-ins can't provide functions that you could use in a formula. This is an Excel Automation Add-in, also COM based.

I suppose that foreground and background refer to the Excel window being the active one. Excel may show errors when some methods are called on an inactive window. Consider not selecting a cell while the window is inactive. If you show some code it could help me understand the issue better.

Regards from Poland (GMT+2),

Andrei Smolin
Add-in Express Team Leader
Posted 17 May, 2024 19:35:38 Top