×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Editing an existing Excel table via VB

Editing an existing Excel table via VB

Editing an existing Excel table via VB

(OP)
I cannot find the code to allow me to edit an existing Excel table in a drawing.  I have all the code working that changes the actual cells, but I can't find what I need to make the table "active"- the equivalent of double clicking on it.  Any suggestions?

RE: Editing an existing Excel table via VB

Is it an Excel-based BOM?  If so, the following commands should work.

BomTable::Attach3
BomTable::Detach

RE: Editing an existing Excel table via VB

(OP)
It's not a BOM, but it is Excel-based.  It's just a standard MS Excel Worksheet that was inserted either by  Insert\Object\Worksheet or copy/pasted in.

RE: Editing an existing Excel table via VB

Well, I thought ObjectDisplayasContent would work, but...

What else have you tried?

Evan T. Basalik, MCSD
--------------------------------
It's all about prioritization...

RE: Editing an existing Excel table via VB

(OP)
ModelDoc2.ActivateSelectedFeature did the trick (thanks Earl).  That worked great to get me into edit mode, now I cn't figure out how to get out of it!  I have used selectbyID to pick a blank spot (which should kick me out of editing the table), but it doesn't do anything.  I need a "deActivateSelectedFeature" ... but haven't found anything yet.

RE: Editing an existing Excel table via VB

What if you just select another feature?  Or, clear selection?

Evan T. Basalik, MCSD
--------------------------------
It's all about prioritization...

RE: Editing an existing Excel table via VB

(OP)
I have used selectbyID to pick a blank spot (which should kick me out of editing the table), but it doesn't do anything. I also have tried selecting a view and activating it- it didn't like that at all.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources