When I run my software from the C: drive the AutoOpen is called. When
I run the version that I moved to another drive the AutoOpen is not
called.
The directory structures are the same, my PATH environment variable is
the same.
Any ideas will be greatly appreciated.
This is strange. Is the add-in loading properly, but the AutoOpen just
not called?
Did you just change the location, or the name of the add-in (and .xll)
as well?
Maybe your problem has to do with the version of
ExcelDna.Integration.dll that you are referencing.
Best is to try the add-in without having a copy of
ExcelDna.Integration.dll in the same directory (or your working
directory, or your path..?) You might have conflicting versions of the
ExcelDna.xll at runtime and ExcelDna.Integration.dll referenced at
compile-time.
You need only have a copy of ExcelDna.xll, called <YourAddin>.xll, the
<YourAddin>.dna file and any of your .dlls referenced at runtime. A
copy of ExcelDna.Integration.dll is embedded in the .xll, and need not
be distributed. Extra copies or different versions of
ExcelDna.Integration.dll might cause problems.
--Govert--
--
You received this message because you are subscribed to the Google Groups "ExcelDna" group.
To post to this group, send email to exce...@googlegroups.com.
To unsubscribe from this group, send email to exceldna+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/exceldna?hl=en.
Certainly no functions will be exported from your add-in if
ExcelDna.Integration.dll does not load - but it might load from a file
or from the embedded resource inside ExcelDna.xll.
Can you check whether the add-in AutoOpen is called in the network
scenario when your add-in is just a .dna file (you can try with
MoreSamples.dna in the distribution.)
Perhaps you can re-check that your .dll is referencing a version of
ExcelDna.Integration.dll that matches the ExcelDna.xll. this is the
only case I can think of where the Excel UDF functions would be
exposed, but the IExcelAddIn.AutoOpen not recognized and run.
Regards,
Govert
> >> exceldna+u...@googlegroups.com<exceldna%2Bunsubscribe@googlegroups.c om>
To unsubscribe from this group, send email to exceldna+u...@googlegroups.com.
I am confused:
An earlier e-mail said: "On the network drive, The Auto-open is not
called, yet all the functions in
XLL are registered and are useable."
But now you say: "...when I copy all of the files to another
computer.
AutoOpen does not get called and my functions are not getting
registered."
If no functions are registered (and AutoOpen is also not called), you
might have .Net trust issues for the network location, and need to set
these with CasPol - check this thread:
http://groups.google.com/group/exceldna/browse_thread/thread/4af520086389839a/0a574583902c8d89?lnk=gst&q=caspol#0a574583902c8d89
and this StackOverflow question:
http://stackoverflow.com/questions/423504/net-2-0-application-from-network-share-without-fulltrust.
The behaviour changed in .Net 3.5 SP1.
If the functions _are_ registered, but your IExcelAddIn.AutoOpen is
just not running when deployed over the network, I am not sure what
the problem is...
Could you perhaps clarify the situation?
--Govert--
> > <exceldna%2Bunsubscr...@googlegroups.c om>
> > > >> .
> > > >> For more options, visit this group at
> > > >>http://groups.google.com/group/exceldna?hl=en.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "ExcelDna" group.
> > To post to this group, send email to exce...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > exceldna+u...@googlegroups.com<exceldna%2Bunsubscribe@googlegroups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/exceldna?hl=en.- Hide quoted text -
>
> - Show quoted text -
To unsubscribe from this group, send email to exceldna+u...@googlegroups.com.
Maybe you still have permissions issues - did you run the CasPol
command.
In any event, the AutoOpen always seems to run fine in my tests, but
calls to XlCall.Excel(...) and presumably to the Excel COM interfaces
might have problems. You could test by simplifying your AutoOpen
function...
I tried the following:
1. I make a directory called CompiledSample.
2. I make a file called CompiledSample.cs with the following content:
using System.Windows.Forms;
using ExcelDna.Integration;
public class MyAddIn : IExcelAddIn
{
public void AutoOpen()
{
MessageBox.Show("Now in AutoOpen.");
}
public void AutoClose()
{
MessageBox.Show("Now in AutoClose.");
}
}
public class MyFunctions
{
public static double CompiledSin(double angle)
{
return (double)XlCall.Excel(XlCall.xlfSin, angle);
}
}
3. I make a file called MakeCompiledSample.bat with:
c:\windows\microsoft.net\framework\v2.0.50727\csc.exe /
reference:ExcelDna.Integration.dll,System.Windows.Forms.dll /
target:library CompiledSample.cs
4. I copy ExcelDna.Integration.dll from the distribution into the
directory CompiledSample.
5. I run MakeCompiledSample.bat, which creates the file
CompiledSample.dll.
6. I create CompiledSample.dna with:
<DnaLibrary Description="CompiledMoreSample Test Add-In"
Language="CS">
<ExternalLibrary Path="CompiledSample.dll"/>
</DnaLibrary>
7. I copy CompiledSample.dll, CompiledSample.dna and ExcelDna.xll to a
new server directory \\server\development\ExcelDna\, and rename the
ExcelDna.xll to CompiledSample.xll.
8. Test Run 1 - I open CompiledSample.xll from the network path. The
AutoOpen messagebox shows. In a sheet, the function =CompiledSin(1)
fails returning #ERROR. This is because the assembly can't call back
to Excel due to permissions issues.
9. I run "CasPol.exe -m -ag 1.2 -url file://server/development/exceldna/*
FullTrust" from a Visual Studio prompt on my machine.
10. Test Run 2 - I open CompiledSample.xll from the network path. The
AutoOpen messagebox shows. In a sheet, the function =CompiledSin(1)
returns 0.841470985. Everything seems OK.
Let us know how this compares with your experience.
Regards,
Govert
> >http://groups.google.com/group/exceldna/browse_thread/thread/4af52008...
> > and this StackOverflow question:
>
> >http://stackoverflow.com/questions/423504/net-2-0-application-from-ne...
> > > >http://groups.google.com/group/exceldna?hl=en.-Hide quoted text -
>
> > > - Show quoted text -
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "ExcelDna" group.
> > To post to this group, send email to exce...@googlegroups.com.
> > To unsubscribe from this group, send email to