Excel PIA & .NET Security

H

helix

Hi,

I'm pretty new to PIA and have been experimenting with Excel's Primary
Interop Assembly and MC++. I've created a worksheet that links into my dll
via the _AssemblyLocation0 and _AssemblyName0 properties. However, when I
open the worksheet, I get an warning which looks something like this:

"The currenct .NET security policy does not permit myApp to run on the
folder E:\. Do not change the security policy in your computer. The .NET
security policy is controlled by your administrator or teh developer who
wrote the custom macros...."

All the code was developed on the same machine under the same user, so I
don't understand why it's not letting it run. Any comments would be
gratefully received !!

Many thanks,
Helix
 
C

Cindy M -WordMVP-

Hi =?Utf-8?B?aGVsaXg=?=,

I've only ever encountered using these properties when creating a VSTO 2003
document. It may well be that you're able to invoke the loader with C++,
about that I wouldn't know. But...

When Visual Studio sets up a C# or VB.NET VSTO project, it also executes a
caspol on the development machine (locational security) to trust the DLL
(project solution). If that folder is moved, or the project deployed, the
security policy has to be created on the target machines. As with anything
.NET, this can be based on any combination of location, digital signature and
strong name you like.

Assuming that you have to do everything "from hand", then you also need to
set a policy (locational) to trust the DLL during development/testing.
I'm pretty new to PIA and have been experimenting with Excel's Primary
Interop Assembly and MC++. I've created a worksheet that links into my dll
via the _AssemblyLocation0 and _AssemblyName0 properties. However, when I
open the worksheet, I get an warning which looks something like this:

"The currenct .NET security policy does not permit myApp to run on the
folder E:\. Do not change the security policy in your computer. The .NET
security policy is controlled by your administrator or teh developer who
wrote the custom macros...."

All the code was developed on the same machine under the same user, so I
don't understand why it's not letting it run. Any comments would be
gratefully received !!

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 
H

helix

Thanks Cindy,

I've managed to solve the problem. It was just a case of setting up the
appropriate security permissions.

I'm not sure if I'll perservere with MC++ and PIA as there's no
documentation support for it and having spent several hours trying to get a
basic OfficeCodeBehind app working, I haven't yet succeeded. For legacy
reasons I need to stay with C++, so sadly I'll probably just go back to using
the Windows API and XLL's - they work and I don't have to waste my time with
ugly syntax, e.g. type.Missings everywhere.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top