Design Tables and VBA code
Design Tables and VBA code
(OP)
So when did Solidworks Design Tables stop allowing VBA code within the Design Table? Years ago I used to be able to write full programs within SW Design Tables and now after building my new Toolbox files the Design Tables always removes the VBA code after I close the Design table in the part file? Such Bologna! Any one seen this or know of a different solution. Equations won't do what I want to do.
Scott Baugh, CSWP 
CAD Systems Manager
Evapar
www.evapar.com
FAQ731-376: Eng-Tips.com Forum PoliciesQuote:
"If it's not broke, Don't fix it!"






RE: Design Tables and VBA code
-handleman, CSWP (The new, easy test)
RE: Design Tables and VBA code
-handleman, CSWP (The new, easy test)
RE: Design Tables and VBA code
I am using office 2013.
I am glad you found the solution. How to I go about saving a template that supports macros\vba, then force SW to use that template?
When I look at the save as template in excel its just an *.xltx, it doesn't give descriptive information as to whether or not it supports macros\vba. Nevermind I found the correct template... my bad I looked right over it. The Auto-create DT doesn't have a direct way to forcefully use a specific template. Browsing for a pre-made DT is not something I want to do, because it has to be made in laid out in a different way (at least it used to be that away).
Scott Baugh, CSWP
CAD Systems Manager
Evapar
www.evapar.com
FAQ731-376: Eng-Tips.com Forum Policies
RE: Design Tables and VBA code
Explanation:I want to be able to load a Macro enabled Excel template. Due to this limitation I cannot create macros or add VBA inside Design tables anymore. Prior to Excel making two different file types for Macro enabled and regular Excel files adding VBA to a Design Table was possible now its not and its a limitation... IMO its more of a regression, because this was available.
Scott Baugh, CSWP
FAQ731-376: Eng-Tips.com Forum PoliciesCAD Systems Manager
Evapar
www.evapar.com
RE: Design Tables and VBA code
Add a default Design Table, save the DT as an Enabled macro table. Delete the table in the file. Insert a new DT and browse for the one I just made.
That seemed to work, but I have not tested it after its checked into the vault yet. Real PITB... would be easier if I could load a template from within SW instead.
Scott Baugh, CSWP
FAQ731-376: Eng-Tips.com Forum PoliciesCAD Systems Manager
Evapar
www.evapar.com
RE: Design Tables and VBA code
Why is it you don't want to start from a file? Is it so that AutoCreate pulls in all the params for you?
-handleman, CSWP (The new, easy test)
RE: Design Tables and VBA code
In previous versions of SW, when you browse for a DT you did not get an information cell only the Parameter and a Value Cell. The information cell is vital to knowing what the parameters are.
The images above shows where I have tried browsing for a DT and this occurs. You cannot add the information cell into either before or after because its not recognized. I asked about this back in 2001-2002 and Support said that is just the way it is.
The other reason is I don't want to have an externally linked table. I want all my DT embedded in the file. I know there is an option not to select and this works fine if its just me doing all of the work.
Yesterday when I made the DT from Auto Create, saved it, deleted the DT, re-added it and browsed to the one I just saved. That worked with the information cell, but I only tried it one time. I have not had a chance to test this further.
Scott Baugh, CSWP
FAQ731-376: Eng-Tips.com Forum PoliciesCAD Systems Manager
Evapar
www.evapar.com
RE: Design Tables and VBA code
Just take your working, autocreated DT that you saved out, delete the params and config names, and then you can re-use it as a blank.
Or, just FYI, the key thing that tells SW where to start the DT is a cell named "Family". If you'll notice when you select cell A2 of an auto-create DT, the cell name is "Family" in the little top left corner box. You can name whatever cell you want in column A (or maybe any column, not sure) "Family" and that will be the corner of the DT.
-handleman, CSWP (The new, easy test)
RE: Design Tables and VBA code
"Re-use as a blank" - That's is good idea, never thought about that, Thanks!
Really "Family" I never noticed that. So I can change the named cell to another cell and that is where the DT will start? That's awesome, because that would allow me to make my programming parameters above the DT.
Scott Baugh, CSWP
FAQ731-376: Eng-Tips.com Forum PoliciesCAD Systems Manager
Evapar
www.evapar.com
RE: Design Tables and VBA code
Scott Baugh, CSWP
FAQ731-376: Eng-Tips.com Forum PoliciesCAD Systems Manager
Evapar
www.evapar.com
RE: Design Tables and VBA code
Anyway, glad you got it to work!