Tuesday, February 07, 2012
Solid edge reports using an excel macro ?
Last Post 20 Sep 2010 04:13 PM by Nodski. 2 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
NodskiUser is Offline
New Member
New Member
Posts:2

--
06 Sep 2010 05:02 PM  

Is there a code that can be used in an excel macro that will carry out the equivalent of the user(s) selecting a solid edge assembly file..(.asm) then right click with a mouse, and then selecting the command "report" ?

Thanks in anticipation

Nodski



Jason NewellUser is Offline
Site Owner
Advanced Member
Advanced Member
Posts:895
Avatar

--
07 Sep 2010 09:49 AM  

Source with attachment

' Add reference to "Solid Edge Install Data Type Library (SEInstallData.dll)"
' Add reference to "Windows Scripting Host Object Model"

Sub Demo()
    Call OpenInReport("C:\Program Files (x86)\Solid Edge ST3\Training\Coffee Pot.asm")
End Sub

Sub OpenInReport(strFile As String)
    Dim objInstallData As SEInstallDataLib.SEInstallData
    Dim objFSO As IWshRuntimeLibrary.FileSystemObject
    Dim objShell As IWshRuntimeLibrary.wshShell
    Dim strInstallPath As String
    Dim strReportPath As String
    Dim strCommand As String
    
    Set objFSO = New IWshRuntimeLibrary.FileSystemObject

    Set objInstallData = New SEInstallData
    Set objFSO = New IWshRuntimeLibrary.FileSystemObject
    Set objShell = New IWshRuntimeLibrary.wshShell
    
    strInstallPath = objInstallData.GetInstalledPath
    strReportPath = objFSO.BuildPath(strInstallPath, "report.exe")
    strCommand = """" & strReportPath & """ """ & strFile & """" ' God I hate VB!
    objShell.Run strCommand

    Set objFSO = Nothing
    Set objShell = Nothing
    Set objInstallData = Nothing
End Sub

197492238971.zip

Jason Newell
Applications Architect
www.jasonnewell.net
NodskiUser is Offline
New Member
New Member
Posts:2

--
20 Sep 2010 04:13 PM  
Thanks for your response...
Our I.T. man has said I should not mdoify .dll files as it might affect others, ( thought it would only be my pc ).
I am investigating the BOM custom macro within solid edge...This may take awhile !
Thanks again
Nodski


You are not authorized to post a reply.

Active Forums 4.2
Copyright © 2011 JasonNewell.NET