Hi Govert,
I played a little bit with NetOffice : I removed all the references to
"Excel" or "Office.Core" assemblies from my project and replaced with
the NetOffice ones.
I made the tests on 2 machines :
1) Windows XP + office 2003
2) Windows 7 + office 2010
I will describe below what I used in NetOffice. The whole application
works as before, in both platforms. The only issue is that I cannot
remove the PIAs from the Windows Program manager and I didn't want to
manually remove them from Regedit. So I will have to test the whole
program on a virgin machine (maybe tomorrow).
To know :
1) The "Application" class in NetOffice is a wrapper to the Excel one.
Easy to create :
new Application(null, ExcelDnaUtil.Application);
2) Before creating the "Application" instance, the following line of
code has to be run :
LateBindingApi.Core.Factory.Initialize();
3) All the events have been renamed with "Event" at the end. Ex:
WorkbookActivateEvent instead of WorkbookActivate
4) The enums are in another workspace than the objects :
NetOffice.ExcelApi for excel objects, NetOffice.ExcelApi.Enums for
enums.
5) The COMExceptions seem to be catched and rethrown. So if you had a
"catch(System.Runtime.InteropServices.COMException)", and it was my
case, now you have to catch a TargetInvocationException. Not very
funny...
These are the only changes I had to make to my code (plus the
references) and it works !
How do I use NetOffice (coupled with DNA) :
1) Create a new worksheet, write tables, draw borders, color cells and
write formulas. Rename the sheet. Hide and unhide it.
2) Open an existing workbook
3) Add a contextual menu
4) Add a menu bar with many items including sub-menus
5) Call for UDFs through DNA (and the call will automatically format
the calling cell), using XlCall.Excel(XlCall.xlfCaller) etc.
6) Use RTD server
7) Make a com server and call to the UDFs from VBA
It would be take time to make small examples for all of that but there
are a lot of examples in the sources provided by NetOffice.
So Govert, do you plane to move to NetOffice ?
Regards
Ron
On Jun 30, 2:00 pm, Ronan Mouquet <
ronan.mouq...@gmail.com> wrote:
> Hi Govert,
>
> What a coincidence, I was just complaining about the fact that I could have
> to deploy 3 different versions of the PIA according to Excel version !
> I think I will test it next week.
>
> Cheers
> Ron
>
> On Thu, Jun 30, 2011 at 1:44 PM, Govert van Drimmelen <
gov...@icon.co.za>wrote:
>
> > Hi Excel-DNA Users,
>
> > I've just noticed a very intruiging project on CodePlex called
> > NetOffice athttp://
netoffice.codeplex.com.