Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is there an Application.Activate method for Word but not for Excel?

Tags:

ms-word

excel

vba

A Word.Application object exposes an .Activate Method.

An Excel.Application object, on the other hand, only exposes an .ActivateMicrosoftApp method which performs a notably different function to "activate this particular application object".

Why isn't there an Excel.Application.Activate Method?

like image 486
Kaz Avatar asked Jun 13 '16 14:06

Kaz


People also ask

What to do if Microsoft Office 2013 cannot be activated?

As you have activated Office over by phone, let’s restart the computer and then verify the results. If issue persists, lets try activating Office 2013 again and check. Click on File, Account and then click on Activate Product. For more information, refer to the following link ‘Activate Office 2013 programs’ and check if it helps:

How do I activate a workbook in Excel?

Use Ctrl+: Ctrl+; Enter for current date & time. The AppActivate statement requires the title of the title window. In any case, here's another approach. First, assign your workbook to an object variable, and then refer to that variable when you want to activate that workbook.

Does appactivate change the focus of the window?

The AppActivate statement changes the focus to the named application or window but does not affect whether it is maximized or minimized. Focus moves from the activated application window when the user takes some action to change the focus or close the window. Use the Shell function to start an application and set the window style.

How to fix Microsoft Word 2013 not opening in Windows 10?

To fix the issue, try the following trick: Right click on shortcut of Word 2013 , Excel 2013 or PowerPoint 2013 in Start Menu or Start Screen, and select Run as Administrator . Then, activate the Office suite.


1 Answers

Boring answer: because Word.Application and Excel.Application are entirely different types, with entirely different implementations.

Outlook.Application doesn't expose an Activate member either. Heck, it doesn't even expose a Run method.

I'm not even sure these Application classes share anything more than a type name. There is a basic "contract" that needs to be fulfilled (e.g. a VBE host's top-level object must have a Name), but things like Activate and Run aren't on that contract. As far as I know the "contract" has more to do with the plumbings than with the interface that's visible to VBA (e.g. thou shalt expose an IStream for all components, and implement an IStorage so the VBE knows where and how to persist the code).

like image 59
Mathieu Guindon Avatar answered Sep 19 '22 15:09

Mathieu Guindon