Changing Excel Macros for ST4

Hi guys,

 

I am looking for some help, we just upgraded our systems to ST4 and I need to update our excel macros for ST4 vs ST3.  I am at a standstill.  I was not the original writer at the macros and am not the most vb savy person.  But i have changed all of the pathways for programs and am still not getting anywhere.  I will attach our macro file below if anyone can help me that would be great!

 

Thanks,

Mike

 

 

Posted by: michael Fronk
Post date: 8/17/2011 10:08:01 AM

4 REPLIES

RE: Changing Excel Macros for ST4

this is before i changed the pathways

 

Posted by: michael Fronk
Post date: 8/17/2011 10:08:39 AM

RE: Changing Excel Macros for ST4

Hi Mike,

 

Like you said first thing is to update any paths that are hardcoded in (search for ST3 and replce with ST4)

Update:

C:\Program Files\Solid Edge ST3\...

to

C:\Program Files\Solid Edge ST4\...

 

Then see if they work (I supose they won't otherwise you wouldn't have posted!).

 

Next place to check is the References in the VB Editor (Tools > References).

Look down the list to see if any are shown as "MISSING", if so make a note of what they are and update them by clicking browse and pointing to the relevant place in the ST4 program folders.

 

Once you've updated any References then try to run your macros and post any errors you may be getting. They may be caused by changes in functionality between ST3 and ST4. Unfortuately I don't have ST4 installed yet so can't debug any further right now.

 

Let me know how you get on.

 

Alex.

 

Posted by: Alex Lush
Post date: 8/17/2011 9:51:48 PM

RE: Changing Excel Macros for ST4

Hi Mike,

 

as Alex already mentioned, you have to remove and re-add the references to the Solid Edge COM libraries. One big change announced for ST4 is, that there are no more specific sync namespaces (i.e. SolidEdgePartSync, introduced formerly with ST). Instead the "normal" namespaces for SolidEdgePart etc. have to be taken. As i could see, your macro keeps references to those no longer available sync namespaces.

 

 

Posted by: Wolfgang Kunert
Post date: 8/19/2011 2:46:28 AM

RE: Changing Excel Macros for ST4

Hi,

 

Did you ever manage to get the macros working? I'm struggling with the same thing, and my code isn't even that complicated. I'm just stuck with it and can't get it working anymore with ST4. With ST2 it works like a charm..

 

 

EDIT: I've now created a module with vb.NET in Visual Studio 2010 and still won't get it working to save custom properties to an active .par. I got it working once, and then the functionality stopped... could someone provide me a code for storing data to active file's custom properties' fields?

 

EDIT2: It must be a bug in ST4 since a straight copy+paste from the Solid Edge Programmer's guide won't work. It works great with ST2 and ST3, which both offer the very same Programmer's guide in their help database.

 

EDIT3: It turned out to be a licensing problem. I'm using SE ST4 Design & Drafting-license, and it no longer supports macros, yey! Wiht Foundation and Classic everything works ok.

 

EDIT4: According to this document: http://www.plm.automation.siemens.com/de_de/Images/3114_tcm73-5038.pdf it shouldn't be a license-related problem. So, it's just a non-working combination - Solid Edge ST4 x64 + Windows 7 Pro x64, Active Solid Edge sessions can't be accessed... if someone has a solution to this, I'm all ears.

 

A firstchance exception of type 'System.Runtime.InteropServices.COMException' occurredin SE Part Mod.exe

A firstchance exception of type 'System.InvalidCastException' occurred in mscorlib.dll

Are the errors, which are caused by this:

 

 

 

 ' Connect to a running instance of Solid Edge

             objApplication = Marshal.GetActiveObject("SolidEdge.Application")

             ' Get a reference to the active document

             objDocument = objApplication.ActiveDocument

             ' Get a reference to the document's property set collection

             objPropertySets = objDocument.Properties

             ' Get a reference to the Custom properties

             objProperties = objPropertySets.Item("Custom")

 

 

 

 

Posted by: Janne Heinonen
Post date: 12/12/2011 6:06:55 AM