Grasshopper

algorithmic modeling for Rhino

Hi everyone-

 

So...due to increasing buginess and crashing issues, I had to reinstall Windows 7, which meant losing all the software that came with the disk image I got as a student, including MS Office 2007.  So I went out and bought Office 2010, and all my Excel interopservices vb.net scripts are now failing.  They had all worked fine before...now when I execute they give the following error:

error: Invalid class string (Exception from HRESULT: 0x800401F3 (CO_E_CLASSSTRING)) (line: 0)

 

Here's the boiled down script:

 

If activate = True Then


Dim oldCI As System.Globalization.CultureInfo = system.Threading.Thread.CurrentThread.CurrentCulture

System.Threading.Thread.CurrentThread.CurrentCulture = New System.Globalization.CultureInfo("en-US")


Dim xlApp As Object

xlApp = System.Runtime.InteropServices.Marshal.GetActiveObject("Excel.Application")

Dim xlSheet As Object

xlSheet = xlApp.ActiveSheet

xlSheet.Range("A1").Value = "test"


End If

 

The failure happens with the addition of the InteropServices line.  I'm mid-project right now, and it's pretty critical that I regain the ability to go back and forth from GH to Excel in the scripting environment...does anyone know if I need to deactivate any security options in Windows, make sure any dll's are properly installed...anything? I've tried all of the other Excel components that various users here have already been generous enough to share (my scripts are all based on them).  I can't seem to find any documentation (that I understand) about this particular error message, or how to fix it.  Really could use a little help!

 

thanks in advance,

 

Dave

Views: 1204

Attachments:

Replies to This Discussion

Found the problem, from this forum:

 

http://social.msdn.microsoft.com/Forums/en-US/vcmfcatl/thread/c9e3e...

 

If you're going to install Office 2010 via download, make sure you bring in the whole executable package (586 megs) and don't do the "INSTALL NOW" option, which doesn't add the ProgID's for the Office applications to the registry...instead pick the "advanced" options, and select either the 32 or 64 bit version.  That pops all the necessary info into the registry.  Whew!

Thanks for following up.

 

--

David Rutten

david@mcneel.com

Poprad, Slovakia

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service