NetOfficeFw / NetOffice

🌌 Create add-ins and automation code for Microsoft Office applications.
MIT License
697 stars 143 forks source link

Address Property of Range Object has no parameters (NetOffice 1.6.0) #77

Closed netoffice-bot closed 6 years ago

netoffice-bot commented 11 years ago

Issue by eugene_huang Sun, 14 Jul 2013 11:35:43 GMT Originally opened as https://netoffice.codeplex.com/workitem/19965


I tried migrating my .NET application (Microsoft Excel Add-In) from NetOffice Release 1.4.1 to 1.6.0 (latest), and am experiencing an error with my code. Specifically, the Address property of the Range object appears not to have any parameters ie. Address() - May I please know if this is intended? For your reference, I am currently working with .NET 2.0.

Thank you in advance.

netoffice-bot commented 11 years ago

Comment by Mon, 15 Jul 2013 13:48:17 GMT


do you use Visual Basic? (VB has a syntax issue here, you need the get_ version)

Sebastian

netoffice-bot commented 11 years ago

Comment by Mon, 15 Jul 2013 15:33:44 GMT


Hi Sebastian,

Thank you for your prompt response. Yes, I'm working with Visual Basic and your solution worked perfect. Thank you again.

I now, however, experience another error when I run my compiled add-in on Microsoft Excel (Please refer to the attached file for the error messages). This error does not occur when I run my other compiled .NET applications (Microsoft Word, Microsoft PowerPoint Add-Ins), which have also been migrated from NetOffice 1.4.1 to 1.6.0. Please let me know if I should raise this as a separate issue on the discussion board.

For your reference, I am testing the compiled add-in on Microsoft Excel 2007, Windows Vista.

Thank you again.

Eugene

netoffice-bot commented 11 years ago

Comment by Mon, 15 Jul 2013 16:35:46 GMT


did you use the netoffice tools namespace?

netoffice-bot commented 11 years ago

Comment by Tue, 16 Jul 2013 15:15:18 GMT


Pardon my ignorance; I'm not entirely familiar with namespaces. I don't believe I used the "netoffice tools namespace" but I may have done so unknowingly. Is there anyway I can check to find out?

To let you know, I am using the Assemblies:1. ExcelApi.dll2. NetOffice.dll3. OfficeApi.dll4. PowerPointApi.dll5. VBIDEApi.dll6. WordApi.dll

Thanks again.

netoffice-bot commented 11 years ago

Comment by Tue, 16 Jul 2013 22:57:14 GMT


no worries. the tools namespace is a new 1.6 feature.as first try to debug the problem.go the menu debugging/exceptions and activate the checkbox 'Common Language Runtime Exceptions' now go to the project properties/debugging and hit the option 'start external program' and choose your office application(path)now start debugging and see where the exception occurs in your code

Sebastian

netoffice-bot commented 11 years ago

Comment by Wed, 17 Jul 2013 16:38:10 GMT


Sebastian,

Thank you for your advice.

The error appears to result from the following block of code:

Dim excelProxy As Object = System.Runtime.InteropServices.Marshal.GetActiveObject("Excel.Application")Dim xlApp As Excel.Application = New Excel.Application(Nothing, excelProxy)

The precise error message is attached to this message, for your reference.

I really appreciate your help and patience with this.

Eugene

netoffice-bot commented 11 years ago

Comment by Thu, 18 Jul 2013 14:47:15 GMT


the error occurs in which line ??the last ?? :o ( the assert message tolds me you try to call a method.N0 doesnt use Debug.Assert btw. you do?*scary

netoffice-bot commented 11 years ago

Comment by Thu, 18 Jul 2013 15:30:17 GMT


I've tried testing it again, and can now confirm that the error occurs in the following line:

Dim xlApp As Excel.Application = New Excel.Application(Nothing, excelProxy)

Yes, I used "Debug.Assert" to debug the code as I have difficulty doing so through Visual Studio (dll is called by vba). Is there is any way I can circumvent this? I tried debugging on Visual Studio using the instructions you provided (ie. specified excel as an external program), but nothing happens when I hit "debug" (an instance of Excel starts up but nothing happens thereafter).

Thank you again.

netoffice-bot commented 11 years ago

Comment by Thu, 18 Jul 2013 17:45:46 GMT


its possible that your vba code is executed while excel is starting?

about the debugging: can you tell me your target .net version and vs version?

netoffice-bot commented 11 years ago

Comment by Fri, 19 Jul 2013 13:33:43 GMT


I deleted the VBA files (which run on excel startup) prior to debugging, so it's unlikely the VBA files were interferring with the debugging process.

My target .NET version is 2.0, and I'm working with Visual Studio Express 2008.

netoffice-bot commented 11 years ago

Comment by Sun, 28 Jul 2013 11:20:51 GMT


Hi Sebastian,

May I please know if you've had the chance to review my query? Please let me know there's any additional information you require.

Thank you,Eugene

netoffice-bot commented 11 years ago

Comment by Sun, 28 Jul 2013 12:21:54 GMT


when its possible, please send me your solution (incl. the netoffice binaries u use) to public.sebastian[at]web.de, remove all privat code you if want and give me instructions how i can reproduce your scenario.

Sebastian