--------------------------------------------------
Enjoying our project?
Consider supporting its continued development by becoming a GitHub Sponsor.
Your help ensures we can keep improving and assisting you.
--------------------------------------------------
--
You received this message because you are subscribed to the Google Groups "Excel-DNA" group.
To unsubscribe from this group and stop receiving emails from it, send an email to exceldna+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/exceldna/67008aa5-1776-4967-b6a3-e0af6bbc7249n%40googlegroups.com.
I can get the .tlb to be created (seemingly correctly) and packed into the .xll.
But when I Tools -> Reference the .xll in VBA it doesn’t show an error, but doesn’t get added as a reference either.
So there are definitely some tricks I don’t get yet.
Anyway, your first problem may be that you are running into one problem I mentioned in my previous response
* The first time I build, I see in the build output that the TyepLib is not packed , but that it is generated after the packing step.
When I then rebuild, the .tlb file is already present when the packing step runs, and it is packed (I presume the one from the previous build) and then the tlb is generated again.
We'll investigate the build sequence a bit, but you might be able to get it working like this.
You can see in the build output whether the ExcelDnaPack task is putting the TypeLib into the .xll or not.
It looks like the build process is only making the typelib after the packing, so you have to build twice to get the typelib into the packed .xll.
You’ll then see this:
1> Task "PackExcelAddIn"
1> PackExcelAddIn: Running PackExcelAddIn Task
1> PackExcelAddIn: Using base add-in bin\Debug\net6.0-windows\NewComServer-AddIn64.xll
1> PackExcelAddIn: ~~> ExternalLibrary path NewComServer.dll resolved to bin\Debug\net6.0-windows\NewComServer.dll.
1> Assembly loaded during TaskRun (ExcelDna.AddIn.Tasks.PackExcelAddIn): NewComServer, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null (location: , MVID: de144b3f-b9e9-4f33-9c50-96e365b1a85c, AppDomain: [Default])
1> PackExcelAddIn: ~~> ExternalLibrary typelib path resolved to bin\Debug\net6.0-windows\NewComServer.tlb.
1> PackExcelAddIn: -> Updating typelib: Type: TYPELIB, Index: 1, Length: 2796
1> PackExcelAddIn: -> Updating resource: Type: DNA, Name: __MAIN__, Length: 597
1> PackExcelAddIn: -> Updating resource: Type: ASSEMBLY_LZMA, Name: NEWCOMSERVER, Length: 4170
1> PackExcelAddIn: Completed Packing bin\Debug\net6.0-windows\publish\NewComServer-AddIn64-packed.xll.
1> Done executing task "PackExcelAddIn".
Even after that, I’m not sure it will work . . .
I’ll check further as I get a chance.
-Govert
From: exce...@googlegroups.com <exce...@googlegroups.com> On Behalf Of Corku
Sent: Wednesday, September 27, 2023 12:43 PM
To: Excel-DNA <exce...@googlegroups.com>
Subject: [ExcelDna] Re: Trying to get the DnaComServer sample to work by modifying the Project file
Dear Govert..
Looks like the fun continues..
The TypeLib is not being generated.. on my machine.
The late bound VBA code works but I cannot Tools - Reference the **AddIn-packed.xll file
Do I need to install the DsCom tool for this to work?
Thanks..
On Wednesday, September 27, 2023 at 12:39:13 PM UTC+3 Corku wrote:
Thanks again.. It worked!
Have an awesome day!
On Tuesday, September 26, 2023 at 1:44:39 PM UTC+3 Corku wrote:
Dear Govert,
Thanks for the assistance. Very much appreciated.
I tried both the orig com and the dscom versions and l still get the same error.
and
The fun continues ..
Will be nice to solve this puzzle.
Thanks
--
You received this message because you are subscribed to the Google Groups "Excel-DNA" group.
To unsubscribe from this group and stop receiving emails from it, send an email to exceldna+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/exceldna/f8e1bd4c-394d-4d2a-b76d-b60388ba8a94n%40googlegroups.com.
The first time I build (with a clean output directory) I also don’t get the .tlb packed. But it does create the .tlb in a task a bit later.
That part looks like this:
1>Target ExcelDnaDscomIntegration:
1>Target DsComExportTypeLibraryAfterBuild:
1> Building target "DsComExportTypeLibraryAfterBuild" completely.
1> Output file "C:\Temp\NewComServer\bin\Debug\net6.0-windows\\NewComServer.tlb" does not exist.
1> Task "Message"
1> Calling dscom.exe to export type library
1> Done executing task "Message".
1> Task "Message"
1> Using arguments ' tlbexport --asmpath "C:\Users\GovertvanDrimmelen\.nuget\packages\exceldna.addin\1.7.0-rc6\build\..\tools\net452" C:\Temp\NewComServer\bin\Debug\net6.0-windows\NewComServer.dll --out "C:\Temp\NewComServer\bin\Debug\net6.0-windows\\NewComServer.tlb"' to call dscom
1> Done executing task "Message".
1> Using "Exec" task from assembly "Microsoft.Build.Tasks.Core, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
1> Task "Exec"
1> C:\Users\GovertvanDrimmelen\.nuget\packages\dspace.runtime.interopservices.buildtasks\1.2.0\build\..\tools\x64\dscom.exe tlbexport --asmpath "C:\Users\GovertvanDrimmelen\.nuget\packages\exceldna.addin\1.7.0-rc6\build\..\tools\net452" C:\Temp\NewComServer\bin\Debug\net6.0-windows\NewComServer.dll --out "C:\Temp\NewComServer\bin\Debug\net6.0-windows\\NewComServer.tlb"
1> Done executing task "Exec".
1> Task "Warning" skipped, due to false condition; (!Exists('$(_DsComExportTypeLibraryTargetFile)')) was evaluated as (!Exists('C:\Temp\NewComServer\bin\Debug\net6.0-windows\\NewComServer.tlb')).
Then in the output directory I can see the .tlb.
The next time I build, it then packs it in the .xll.
Can you see whether that DsComExportTypeLibraryAfterBuild runs on your side?
To view this discussion on the web visit https://groups.google.com/d/msgid/exceldna/c72bbac3-bb1e-48d8-ae87-2617a9b130bcn%40googlegroups.com.
I’m glad you have it working.
Do you need the extra settings on the dSpace package reference – I removed that without obvious consequences.
To view this discussion on the web visit https://groups.google.com/d/msgid/exceldna/9f784f0f-2887-4c2c-a42e-bb9029ef10e0n%40googlegroups.com.