Lesson 7.1 – Using the SolidWorks API With Microsoft Excel

You need to be logged in to view this content. Please login or become a member.

<<  Prev   |   Index   |   Next  >>


In this lesson you will learn how to import data points from an Excel file in order to create a 3D point cloud in a 3D part sketch.


A great resource for learning Excel VBA is cpearson.com.

Instead of using CreateObject(“Excel.Application”) you can also use GetObject(“Excel.Application”) to get the most recent Excel process.

If you want to insert 3D curves and not simply a point cloud, you will need to use IModelDoc2::InsertCurveFileBegin, IModelDoc2::InsertCurveFilePoint, and IModelDoc2::InsertCurveFilePoint.

If a residual EXCEL.EXE process exists even after programmatically closing Excel, you can programmatically kill this process using this line of code: Shell “TASKKILL /F /IM Excel.exe”, vbHide

Lesson Files

Lesson 7.1 code
Code snippets

Questions and Comments

You must be logged in to post a comment.