osamaZain

Dear All ;

I have an Excel app, that i deployed on a local Intranet .

when i open the excel template i have an office exception:

" the assemply could not be found or could not be loaded .. the current .Net security policy does not permit "excel file " to load custom macros"

althought i set the full trust permission to dll using caspol.exe

and .net 2.0 configuration tool

my application under office 2003

and Visual studio 2005

could you help me ..



Re: Visual Studio Tools for Office caspol error

Douglas H. Troy

Check your security level settings in Excel. From the Menu, go to

Tools->Macro->Security and make sure it's set to Medium

I would not set it to low, simply because that poses a security risk. When your customization attempts to load, you maybe prompted by Excel to allow this action, which you would answer "OK" to ...

If that's not it, then you'll need to post the parameters you're using for CasPol, so we can see if there are any problems there ...









Re: Visual Studio Tools for Office caspol error

osamaZain

Thank u Dear Douglas

for u r help ..

i tried to set Mcro Security level .. as u said to me .. but problem was still unsolved ..

for caspol parameters :

caspol -m -ag LocalIntranet_Zone -url \\url\* FullTrust -n name

and also i tried using MS .NET Configuration wizard from Administrative Tools

to set security policy for dll file with the current permission Description:

Assembly evidence must match this membership condition to belong to the code group: StrongName.
Assemblies matching the membership condition are granted this permission set at the current policy level: FullTrust.
Permission Set Description: Allows full access to all resources

but no result .. !!






Re: Visual Studio Tools for Office caspol error

Misha Shneerson - MSFT

Can you be more specific about the error you are seeing when opening the template






Re: Visual Studio Tools for Office caspol error

osamaZain

I did an Excel application load data from dataBase sql server 2005 using .Net 2.0 and under MS Office 2003.

every time when i opened the Excel Template through localintranet , i received an exception with the next message :
The Current .NET Security Policy does not permit file.xls to load custom macros. do not change the security policy in your computer
the .NET security policy is controlled by your administrator or the developer who wrote the custom macros. you can still edit and save the document.

i tried to set permission on my machine with the next parameters:
caspol -pp off -m -ag LocalIntranet_Zone -url \\dss\* FullTrust -n DSS

and
change Macros Security level in Excel file from tools --> macro --> security to medium level

but no result
i still have the same problem.





Re: Visual Studio Tools for Office caspol error

Misha Shneerson - MSFT

Sorry, I can not find this exact error message you are referring to. Are the messages that you get in English or you are trying to translate those

Here are the 2 error messages that seem to be closely related to what you are reporting, but none is the exact match. So, which one you are seeing

The current .NET security policy prohibits <> from loading custom macros. You can still edit and save the current document. Contact your IT administrator or the author of the custom macros for further assistance.

The current .NET security policy does not permit the customization to run. Do not change the security policy in your computer. The .NET security policy is controlled by your administrator or the developer who wrote the customization. You can still edit and save the document. Contact your administrator or the author of this document for further assistance.

Also, which version of VSTO you are using - is it VSTO 2003 or VSTO 2005 (I believe it is VSTO 2003 - but please confirm).






Re: Visual Studio Tools for Office caspol error

osamaZain

before everything i want to thank Misha Shneerson for your support, thank u dear Misha.

I found an important aricle you had write on microsoft.com about Office Deployment , i think it will be very useful for me to found where is the error im my application

for my applcation :

1- I used VSTO 2005 SE .

2- when i run my applcation from my development machine , it works well and no problem.

but when i copy the template to a folder on the local intranet , first error message is:

The current .NET security policy prohibits <> from loading custom macros. You can still edit and save the current document. Contact your IT administrator or the author of the custom macros for further assistance

then i go to Excel template , File --> Properties --> and then set the name for dll and it's location

and save my template and reopen the template .. then i see this message :

The current .NET security policy does not permit the customization to run. Do not change the security policy in your computer. The .NET security policy is controlled by your administrator or the developer who wrote the customization. You can still edit and save the document. Contact your administrator or the author of this document for further assistance.

Now i will read u r articles about office deployment .. may i find where is the solution .