This project has moved. For the latest updates, please go here.

Some advice please for NetOffice beginner

Jun 23, 2016 at 2:52 PM
Hi all,
What a great project this is. I am returning to coding after 13 years break. I was using a lot of COM with Office back then. It seems to be just as difficult as ever to get installed and runinng reliably on a clients machine.
I am new to .net and the NetOffice so I have a bit of a learning curve. I got an addin developed (Using NetOffice) by a freelance, who is no longer around and I am trying to debug it and create some setups.
I think I need to create a new project in order to get all the paths correct, opening the old solution file on my new PC just doesn't work.
here is my first problem. What type of project do I need to create ?
I tried " create new project from existing code" but builds with more than 1000 errors.
Should I use a class file type?
I have VS 2015 community edition

Any advice would be really appreciated.
I am tempted to just find a freelancer again but I am really keen to learn

Thank sin advance

Ed
Coordinator
Jun 25, 2016 at 12:24 AM
hello there,

first of it all: thank you very much. 13 years ago, i end my development in COM/Office with visual basic 6 and start to join the .net idea.

If you want to create an addin, you need to create a "Class Library" project in Visual studio. BTW: the NetOffice examples give you good point to start from.
You find example addin projects in the "$NetVersion\Examples\Addins" folder. (there are 2 options here, the plain IExtensibility2 interface addins like VB6 or the NetOffice.Tools based Addin projects which is more familar to VSTO)

The 1000 errors problem sounds like reference problem. (thats all what i can say at this point, or may a syntax problem, i dont know) make sure to disable the "Embed Interop Types" option for each NetOffice assembly. in other words, goto the references explorer, mark each NetOffice assembly and disable "Embedd Interop Types"
in the property grid.

(If you need a freelancer again, please let me know)
*Sebastian
Jun 27, 2016 at 8:15 PM
Thanks Sebastian,
I do appreciate this and it is good to know I can get a freelancer as I will surely want to at some point.
I am determined just now to get a better grasp of .net and NetOffice so I can architect my stuff properly at least.
I got past the errors and got things running though sadly I am not sure what I did to cause it.
It reminds me of when COM used to stay in memory and run your old code even after debugging. Something like tis was happening.
I kept making new projects and copying stuff across manually until eventually I got all the references to work and ran the app.

What kind of cost can I expect fr a freelancer to do fairly straightforward routines in c# to extend the add-in once i have it in shape?

Ed

Ed Taaffe


Web: www.thebridger.co.uk
Skype: edwardtaaffe
Linkedin:
http://uk.linkedin.com/in/edtaaffe
Mobile: +44 (0) 7730956672





Coordinator
Jun 28, 2016 at 6:43 AM
Hey Ed,

I need some more informations about these errors. so it is compile-time errors right?
Can you give me the first 3 error messages incl. the line(s) of code which is come from?
i still believe in the reference problem(for the >thousand errors), may the
NetOffice assemblies are not in the same .net version or something like that. Have you tried to disable "Embedd Interop Types" - it is an important must-have for NetOffice.
It reminds me of when COM used to stay in memory and run your old code even after debugging. Something like tis was happening.
Yes i remember for something like Set x = Nothing can fix all the problems. (Most of the time the problems comes from "abort debugging" so the cleanup code is never executed)
I want give you a private message for your last question at all.

*Sebastian
Jun 29, 2016 at 10:58 AM
Hi Sebastian,

I resolved this issue and am making progress.
I wish I knew for certain what I id that fixed it. I was stuck in a loop where my code changes were ignored and breakpoints ignored and knew that somehow it was executing another copy of the code. By force of habit (com on MTS back in the day) I rebooted the machine t o force update. Build again and everything worked . I was able to step through and resolve the immediate issues.
I think the problem is that the addin is installing on all live workbooks not just the target one. I had another workbook open for a different client and this workbook possibly had a pointer to the old COM proxy. I'm just guessing, need to really read up on this one day soon.
Thanks for the help. Contact me privately for a discussion on up and coming freelance needs

Ed

Ed Taaffe


Web: www.thebridger.co.uk
Skype: edwardtaaffe
Linkedin:
http://uk.linkedin.com/in/edtaaffe
Mobile: +44 (0) 7730956672





Coordinator
Jun 30, 2016 at 10:25 AM
Hey Ed,

(for your information)
If you use a .net framefork version that is different from 4.5 you may need to create a .config file to make sure Visual Studio want use the debugger you need.
(otherwise your breakpoints doesnt work because VS2015 use the .Net 4.5 debugger by default and each .net framework comes with its own debugger)

*Sebastian