nkgedadknr Posted December 18, 2009 Posted December 18, 2009 I run my code in Excel screen (from a button in ribbon) I want to set focus back to Excel screen(select some cells) after do something(like hide alll entity) in Cad screen, but my code doesn't properly (it still rest focus on cad screen), please help me to solve it: Here my code : Sorry, I forget the way to put the code in a required view, i cannot see the code tag in my screen # Private Sub UnHide(control As IRibbonControl) Dim objApp As Object Dim ExcCap As String ExcCap = Application.Caption On Error Resume Next Set objApp = GetObject(, "AutoCAD.Application") Dim objDoc As AcadDocument AppActivate "AutoCAD", True With objApp Set objDoc = .ActiveDocument Dim objEnt As AcadEntity For Each objEnt In objDoc.ModelSpace objEnt.Visible = True Next objEnt objDoc.Regen acAllViewports End With AppActivate objApp, False Set objDoc = Nothing Set objApp = Nothing AppActivate ExcCap, True End Sub # Quote
nkgedadknr Posted December 20, 2009 Author Posted December 20, 2009 Anybody please help me, I'm stuck with this for long time Quote
fixo Posted December 20, 2009 Posted December 20, 2009 Anybody please help me, I'm stuck with this for long time replace this line AppActivate ExcCap, True with this one AppActivate ExcCap ~'J'~ Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.