VBA - Simulate a click in the solidworks graphics area

Hello

 

My problem is the following:

I have a part on Solidworks in which I insert a part family via an existing file. This one is set, but to "validate" it is necessary to click on the graphic area. The problem is that I have this manipulation done via a macro, and I can't find how to simulate this famous click on the graphics area via VBA.

 

If someone has the solution, I would be very interested.

Thanks in advance!

 

PS: here is the code of my macro (it works very well except that I can't find it for the click)

Sub chgt_famille()

Dim swApp As SldWorks.SldWorks, swModel As SldWorks.ModelDoc2, retVal As Boolean
Set swApp = CreateObject("SldWorks.Application")

Set swModel = swApp.ActiveDoc

retVal = swModel.InsertFamilyTableOpen("Z:\famille.xlsx")


End Sub

Hello

Would the Application.DoubleClick  command  associated with a checkbox suffice?

Hello

After research, I think the Super Macro software could help you get the code for a mouse click.

http://adam.denadai.free.fr/

Hello

swmodel. CloseFamilyTable?

4 Likes

Hello
 

I tried your solutions, one of them worked, it' s Cyril.f's. with "swmodel. CloseFamilyTable"

That's great, thank you for your help!