VB macro with Excel: only for change dimensions?

Pioneer
Pioneer

Hi!

Can I use the Excel Visual Basic Macro for run vb code like a classic exe macro? (for example written with visual studio)

I think that with Excel I only change Variables, or not?

For example: Can I draw a View of a 3D model in a dft file, using an Excel VB macro?

 

Thanks

5 REPLIES

Re: VB macro with Excel: only for change dimensions?

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom
Hi Cek,
Yes you can.
Excel has build in VBA (Visual Basic for Applications). But this is an old version of VB.
You cannot use the nice new language features like in VS.
I do not like this combination of data and code in one file. If you make copies of the excel file and have the data then a change in the code becomes difficult. You have to do this in e dry copy...
Me recommendation is to write an extra program that uses the excel API to read the values and then changes the Solid Edge document.
regards

JB
VS2015, SE ST10

Re: VB macro with Excel: only for change dimensions?

Phenom
Phenom

Hi @Cek

 

Yes, As @JB has mentioned this is possible.

Everything that you can possibly do from Visual Studio standalone EXE can be done from Excel VBA also.

The lanuage to be used is old-fashioned VB but it is powerful as well for moderate purposes.

 

Personally I have a liking for using Excel for some types of Solid Edge automation tasks typically which take tabular data as input. These can be formatted nicely and also sorted, etc.

 

Regards,

~Tushar Suradkar

fb.pngSolid Edge Users Facebook Group

[ Everything under the sun about - Solid Edge ]

Re: VB macro with Excel: only for change dimensions?

Pioneer
Pioneer
Thanks!
I'm not expert in programming.
I try to write some code in Excel, with some example that I find on internet, but I don't know how change code from new vb to old vb.
Can you send some examples to connect with solid edge in vb?
or suggest a guide?
thanks!

Re: VB macro with Excel: only for change dimensions?

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom

Hi,

here is a small example:

  Dim objApp As Object
  Dim oDoc As SolidEdgePart.PartDocument
      
    Set objApp = GetObject(, "SolidEdge.application")
    
    Set oDoc = objApp.ActiveDocument
regards

JB
VS2015, SE ST10

Re: VB macro with Excel: only for change dimensions?

Honored Contributor
Honored Contributor

Hi @Cek

 

 

 

there is a wonderful example available directly witihn the customs folder of Solid Edge

 

Take a look into the "bearing

.

This shows the connection from an Excel table to a Solid Edge Part

 

20170501_1117.PNG



regards
Wolfgang