cancel
Showing results for 
Search instead for 
Did you mean: 

How can I copy a table via vbscript or a method?

asbowes
Explorer
0 Kudos

Can someone point me in the right direction for how to make a copy of a table using vbscript or a method?  I know how to make a new table and set its attributes to the selection's attributes, and add columns and set their attributes to the selection's columns attributes, and so on... but what I want is something in vbscript that does the equivalent of what happens when I copy and paste a symbol in a diagram, or a table in my list of tables.  I've figured out how to do it into a package, but I don't really want packages - I want to make my table and then make 8 copies of it, and rename the few things that need to be renamed.

Does anyone have an example they can share, or a pointer to some instructions?  I've searched and searched to no avail.

Many thanks in advance.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Alison,

I am afraid, that there is no such straightforward function for this (I needed it myself couple months ago). Instead of "manual" copying attribute by attribute, you could use following workaround in your vbscript: create temporary package, use CopyToPackage on your object into this temporary package, raname what you need to rename and then use MoveToPackage to get these copied tables to ther final location.

Regards,

Ondrej

asbowes
Explorer
0 Kudos

Thank you, Ondrej.  If nothing else, at least now I can stop spinning my wheels looking for something that doesn't exist!  And, the workaround you suggest is certainly preferable to setting attribute by attribute.

Of course, we can both hope that someone else responds with an even easier solution, but I am happy to have something at least.

Kind regards and many thanks,

Alison

Answers (0)