If you open the design table first and then open the workbook you want to copy from using the open menu then you can (I believe you need to work backwards from the way you are trying to do it).
Or are you trying to do this without opening either table?
In your example code I see nothing about copying any data
Thanks Solid Air,
Thats just a snipit of the code. Essentially, I am trying to copy from one workbook and paste into the design table. The copying is fine, but the code for pasting is hard because in the function I am using, it requires me to define the location and name of the workbook (in this case I am pasting into a design table), although I dont know where the design table (file location) is stored or what the filename is.
What level of automation are you looking for? I did something similar to what you want to do about 15 years ago and I would have to see if I can still find the code. If I remember correctly I believe you need to open the design table using SolidWorks API calls.
If you are not looking for that level of automation then use my first suggestion and open the design table then open your workbook from that open session of excel.
As for the calls you are using, you will need to change them. Just record a macro copying and pasting from one workbook to another workbook and tweak the code to fit your needs.
I'm in the process of doing the same thing, sort of. You need to open the design table and assign the cell the value you want.
Set swDocXt = swDrawModel.Extension If swDocXt.HasDesignTable Then swDrawModel.InsertFamilyTableEdit Set destable = swDrawModel.GetDesignTable() Set wSheet = destable.EditTable2(True) wSheet.Cells(1, 1) = someValue swDrawModel.CloseFamilyTable End if