animaniacs
2012-08-01 18:48:24 UTC
Hi,
I converted a macro in VBA to a Solidworks Addin in Vb.net
And I have a problem with the Sendkeys function of the code:
Dim swApp As Object
Sub main()
Set swApp = Application.SldWorks
SendKeys ("%(fn)") ' ( I know there is other ways to do this, I only use the "open new document" here as an example )
End Sub
When I convert it to VB.net it doesn't work. Even with a time out:
Public Sub _cbtest()
AppActivate("SolidWorks Premium 2012")
' System.Threading.Thread.Sleep(500)
SendKeys.SendWait("%(fn)")
End Sub
While this one work with wordpad:
Public Sub _cbtest()
AppActivate("WordPad")
SendKeys.SendWait("%(fn)")
End Sub
I converted a macro in VBA to a Solidworks Addin in Vb.net
And I have a problem with the Sendkeys function of the code:
Dim swApp As Object
Sub main()
Set swApp = Application.SldWorks
SendKeys ("%(fn)") ' ( I know there is other ways to do this, I only use the "open new document" here as an example )
End Sub
When I convert it to VB.net it doesn't work. Even with a time out:
Public Sub _cbtest()
AppActivate("SolidWorks Premium 2012")
' System.Threading.Thread.Sleep(500)
SendKeys.SendWait("%(fn)")
End Sub
While this one work with wordpad:
Public Sub _cbtest()
AppActivate("WordPad")
SendKeys.SendWait("%(fn)")
End Sub