I have a macro that works if I have
I have a macro that works if I have
(OP)
I have a macro that works if I have had something opened in the SolidWorks screen. But if I try to run the macro first thing after starting SolidWorks the macro does not run. Is there something that I am missing?
Option Explicit
Dim swApp As Object
Dim Part As Object
Dim Gtol As Object
Dim FeatureData As Object
Dim Feature As Object
Dim Component As Object
Dim MyAppID, ReturnValue
Sub main()
MyAppID = Shell("\\Athena\Eng\Applications\SolidWorks\Executables\OpenPDM.exe", 1)
End Sub
Option Explicit
Dim swApp As Object
Dim Part As Object
Dim Gtol As Object
Dim FeatureData As Object
Dim Feature As Object
Dim Component As Object
Dim MyAppID, ReturnValue
Sub main()
MyAppID = Shell("\\Athena\Eng\Applications\SolidWorks\Executables\OpenPDM.exe", 1)
End Sub
Bradley






RE: I have a macro that works if I have
There is nothing wrong with your code. You can confirm that if you call another app. (excel for example). The macro will run even without an opened doc. I think the problem is on the app. itself. Mabe, when it starts, it will look for a doc. and stops on error because it can't find any. Have you tried to double click on the app., without a doc., to simulate the runing macro?
RE: I have a macro that works if I have
RE: I have a macro that works if I have
I cannot for the life of me remember where I learned about PushKeys.
Option Explicit
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Private Declare Sub PushKeys Lib "KeyPush" (ByVal Keystrokes As String)
Dim swApp As Object
Dim Part As Object
Private Sub Form_Load()
PushKeys "%F/{tab}"
Unload Me
End
End Sub
Bradley
RE: I have a macro that works if I have
Now I remember where you can find out about PushKeys. Go to http://www.nhcad.com/old/html/animationpw.asp
Bradley