ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Is it possible from VBA to run excel as administrator? (https://www.excelbanter.com/excel-programming/453941-possible-vba-run-excel-administrator.html)

[email protected]

Is it possible from VBA to run excel as administrator?
 
Is it possible from VBA to run excel as administrator so that VBA routines that create an instance of Outlook or Word will run as per normal.

GS[_6_]

Is it possible from VBA to run excel as administrator?
 
Is it possible from VBA to run excel as administrator so that VBA routines
that create an instance of Outlook or Word will run as per normal.


Please explain what you mean by "run as per normal". (What abnormal behaviour
are you getting?)

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion

[email protected]

Is it possible from VBA to run excel as administrator?
 
On Thursday, December 21, 2017 at 3:42:30 PM UTC+11, GS wrote:
Is it possible from VBA to run excel as administrator so that VBA routines
that create an instance of Outlook or Word will run as per normal.


Please explain what you mean by "run as per normal". (What abnormal behaviour
are you getting?)

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion


If Excel is not running as an administrator the vba routine that creates the object (CreateObject("Outlook.Application")) doesn't have permission to create an instance of Outlook (or Word).

It works okay on my computer as I have excel set to run as administrator, but it doesn't work on other computers. I can't go an change the settings on all the other computers.

Ulrich Möller

Is it possible from VBA to run excel as administrator?
 
Am 21.12.2017 um 22:47 schrieb :
On Thursday, December 21, 2017 at 3:42:30 PM UTC+11, GS wrote:
Is it possible from VBA to run excel as administrator so that VBA routines
that create an instance of Outlook or Word will run as per normal.

Please explain what you mean by "run as per normal". (What abnormal behaviour
are you getting?)

--
Garry

Free usenet access at
http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion

If Excel is not running as an administrator the vba routine that creates the object (CreateObject("Outlook.Application")) doesn't have permission to create an instance of Outlook (or Word).

It works okay on my computer as I have excel set to run as administrator, but it doesn't work on other computers. I can't go an change the settings on all the other computers.


Check the dcom settings to see if they are correct and change them if
necessary.

Some hints can be found he
https://stackoverflow.com/questions/...mission-denied

Ulrich


GS[_6_]

Is it possible from VBA to run excel as administrator?
 
On Thursday, December 21, 2017 at 3:42:30 PM UTC+11, GS wrote:
Is it possible from VBA to run excel as administrator so that VBA routines
that create an instance of Outlook or Word will run as per normal.


Please explain what you mean by "run as per normal". (What abnormal
behaviour are you getting?)

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion


If Excel is not running as an administrator the vba routine that creates the
object (CreateObject("Outlook.Application")) doesn't have permission to
create an instance of Outlook (or Word).

It works okay on my computer as I have excel set to run as administrator, but
it doesn't work on other computers. I can't go an change the settings on all
the other computers.


Ulrich makes a good point!

Otherwise you can create more than 1 instance of Outlook so the practice is to
check 1st if it's already running using:

Dim appOL As Object, appWD As Object

Set appOL = GetObject("Outlook.Application")
If appOL Is Nothing Then Set appOL = CreateObject("Outlook.Application")

Word on the other hand IS a multi-instance app same as Excel is.

Note also that automated instances are not visible until you set their Visible
property = True. Also, users won't have control until you set the UserControl
property = True.

As far as permissions go.., if a user has permission to use MS Office then
automating its counterparts is allowed.

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion


All times are GMT +1. The time now is 09:55 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com