Macro to open specific Sheet in excel design table

All topics relating to the SolidWorks, eDrawings and PDMWorks APIs

Macro to open specific Sheet in excel design table

Postby eman » Fri Jul 16, 2010 1:58 am

Hello Everyone,

I have a sheetmetal template that uses a design table. When you open the design table in its own window (with excel) it goes automatically to sheet 2 ("on open" code) of the work book.
Before closing it goes back to sheet 1 (via "before close" code). Usually all my data is selected on sheet 2 and linked to sheet 1. I was wondering if anybody knows how to open the design table
via macro then force to switch to sheet 2, force it to switch back to sheet 1 and close the window.
I have a macro that opens the designtable but the "on open" excel call is not executed so it never switches. I just want to synchronize the linked model dimension with the design table incase
it got overriden manually.
Attached is the macro that I use.

Maybe somebody can help.

Thanks a lot,

elmar
eman
 
Posts: 5
Joined: Sat Jan 24, 2009 5:43 am

Re: Macro to open specific Sheet in excel design table

Postby angelsix » Fri Jul 16, 2010 9:22 pm

I tried something a while back for this, and I went through every single event that got called for sheets and workbooks when loaded by SW, and unfortunately SW keeps the book loaded in memory so only fired certain ones. Your best bet is to do the same, just add a MsgBox event on every one and see what gets fired and if you can work with it.

Luke
AngelSix.com
Luke Malpass
ICQ#: 461334120
Email: contact@angelsix.com
User avatar
angelsix
Site Admin
 
Posts: 339
Joined: Sun Mar 16, 2008 5:52 pm
Location: UK


Return to SolidWorks API

Who is online

Users browsing this forum: No registered users and 0 guests

cron