VBA Macro to Renumber Reference Slot Numbers and Change Logical Names of Attachments Released

Important Note: This macro is only compatible with MicroStation version 10.17.02.61 and later.

ReferenceSlotRenumber is a VBA macro that exports reference attachment information to a CSV (comma separated values) file for easy editing. Using Excel, the user can utilize the data grid, Filters, Sorting, range completion, etcetera to quickly and easily edit reference slot numbers and logical names. The user can then import the new slot numbers and logical names back into MicroStation.

To use, place the macro's MVBA file in a folder pointed to by the MS_VBASEARCHDIRECTORIES configuration variable.

The key-in to run the macro to first export the data is VBA Run [ReferenceSlotRenumber]modRefSlotRenum.Main EXPORT. The user then specifies a CSV file to write the data to:

A subset of the reference information is written to an Excel-compatible CSV file:

The user edits the file, specifying the new slot numbers and logical names (if desired).

After saving the CSV file, to import the revised data back into MicroStation, use the key-in VBA Run [ReferenceSlotRenumber]modRefSlotRenum.Main IMPORT:

The information in the References dialog is refreshed:

If you get undesirable results, click Undo > To Mark.

Disclaimer: The developer assumes no liability for damages, direct or indirect, which may result from the use of this program.

Acknowledgements: Thanks to LA Solutions for their excellent online article and source code on Windows Command Dialogs using MicroStation VBA. Thanks also to Bentley colleague Artur Goldsweer, first for his code on reading a reference's slot number in CONNECT, and secondly for the key-in to change a reference's slot number.

ReferenceSlotRenumber.mvba