CATIA VBA - Active Macro Path
CATIA VBA - Active Macro Path
(OP)
I did a search for Active Macro Path.
What I am looking for is an equivalent in VBA for CATIA done in VBA for Excel
VBA: Show workbook location
Sub DisplayWorkbookPath()
MsgBox ActiveWorkbook.Path, vbInformation, "Workbook Path"
End Sub
Can something like this be accomplished within a VBA for CATIA macro?
Hard coding a precise path added the steps of executing the macro from the new location, getting a error, identifying the code responsible for the error and correcting the hard coded path.
Thanks for your consideration in this matter.
What I am looking for is an equivalent in VBA for CATIA done in VBA for Excel
VBA: Show workbook location
Sub DisplayWorkbookPath()
MsgBox ActiveWorkbook.Path, vbInformation, "Workbook Path"
End Sub
Can something like this be accomplished within a VBA for CATIA macro?
Hard coding a precise path added the steps of executing the macro from the new location, getting a error, identifying the code responsible for the error and correcting the hard coded path.
Thanks for your consideration in this matter.
RE: CATIA VBA - Active Macro Path
VBA code in CATIA is very different from what we have in Microsoft Office applications because it's stored in a standalone file (.catvba), which is in fact is proprietary to DS.
And they doesn't expose any methods to work with that file. So you're left with VBE com object that represents VBA editor in which you can get currently active project (written in bold font in project tree) and it's path.
There's no way to get currently executing project by any means.UPD
See kantoku's post below
Great to know we still can access executing project, though not through VBE but APC directly!
RE: CATIA VBA - Active Macro Path
In case of CATIA V5 VBA, it is possible to get the project file path.
try this.
CODE --> vba
RE: CATIA VBA - Active Macro Path
I can adapt that into the code I've got and be able to work with it accordingly.
RE: CATIA VBA - Active Macro Path
RE: CATIA VBA - Active Macro Path
I also got the advice from other people on my blog about how to get the above CATVBA pass.
These macros (CATVBA) are created using VBA reflection.
Link
Link
RE: CATIA VBA - Active Macro Path
Your "VBA reflection" thing brought in some memories of technology we used a few years ago prior to .NET - VBA references
Hope someone will find it helpful someday.
RE: CATIA VBA - Active Macro Path
I tried in the past for CATScript, I wasn't able to find something...interesting that you can find for simple vbs...
Regards
Fernando
https://www.youtube.com/playlist?list=PL9mSHa4SOed...