Click here to Skip to main content
14,636,439 members
Rate this:
Please Sign up or sign in to vote.
See more:

I wrote a lot of macroes in Excel 2010 with Win7.
Now I changed the PC (win10 and Excel 2016). Some of these need to be launched with excel run as administrator. I copied the personal.xlsb file into the right directory, and normally it is loaded, but when I run Excel as administrator, Excel doesn't load it.

There is a way to force Excel to load Personal.xlsb even if it is launched as administrator?

What I have tried:

I was ensured that personal.xlsb was to not disabled (addons -> manage -> disabled elements is empty).
I was ensured that the folder where is personal.xlsb is the right folder even if it is in administrator mode (Application.StartUp is the same directory in both modes)
Dave Kreskowiak 29-Oct-18 12:40pm
What parts of your code require admin permissions? Where is the file copied to that you're trying to load it from? Any error messages?
Menci Lucio 29-Oct-18 12:47pm
«What parts of your code require admin permissions?» A call to an exe application that uses a ODBC/DB2 connection. «Where is the file copied to that you're trying to load it from?» Into the same directory that Application.StartUp says. In particular %UserProfile%\AppData\Roaming\Microsoft\Excel\XLSTART, that is the same in source machine and in destination machine. «Any error messages?» No errors. just Excel doesn't read the Personal.xls if it doesn't run in administration mode.
Dave Kreskowiak 29-Oct-18 13:01pm
Just launching an executable from code should never require admin permissions.

You said you checked in Addins -> Manage -> Disabled elements, but this isn't an addin so that' not going to work.

After launching Excel as admin, go into Options -> Trust Center -> Trust Center Settings -> Trusted Locations, and verify that your %UserProfile%\ApPData\Roaming\Microsoft\Excel\XLSTART folder is listed.

Also, is your user profile folder redirected to a network share?
Menci Lucio 29-Oct-18 13:29pm
Found! (maremmamaiala) The content of the file didn't reflect the extension. I don't remember what I did into the old PC. I opened the file running as not administrator, SaveAs specifyng the file type, now Excel right opens the file.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100