ds-blue-logo
Preview  |  SOLIDWORKS USER FORUM
Use your SOLIDWORKS ID or 3DEXPERIENCE ID to log in.
LFLi Feng03/12/2014

Hi Every one,

I want to make a preview window in a sheetbook of excel with VBA, with the edrawings control.

But fail in shifting showing different sw model by inputting different file location string.

However, It can make it thru shifting the design mode button of excel.

Here is the VBA code, pls help me to check where is the problem , or let me know the correct method of EModelViewControl.

for more information , you can check the attached demo video that showing my question.

download the MP4 video from this link :Vincent Demo.mp4_免费高速下载|百度云 网盘-分享无限制

thank you very much.

regards

Vincent

-----------------------------------------------------------------------------

Sub edrawingViewer()

    Dim SWfile As String

    SWfile = InputBox("input the file location string:")

    With Sheet1

          .EModelViewControl1.Filename = SWfile

          .EModelViewControl1.Refresh

    End With

End Sub

1.jpg

2.jpg

3.jpg