Changing sheet tag numbers using vba

I USE MICROSTATION V8I

1.changing multiple sheets numbers using VBA?

Page numbers are in series 1,2,3---in tags?

2.I have record a VBA fr editing tags text when i play vba i need to press ok and close tag edited dialog box and then it goes for next tag edit

in need help that dialogue box should get close by itself so the VBA works without any interrupt

please give me solution for this if anyone knows solution to it Thank yoiu

  • dialogue box should get close by itself so the VBA works without any interrup

    It's hard to comment without seeing your code.  Post your recorded macro!

     
    Regards, Jon Summers
    LA Solutions

  • Thanks MR Jon for your answer 

    please check the VBA code below

    When i play a vba for multiple file i need to prees PLEASE CHECK THE SCREENSHOT WHICH I NEED TO PRESS OK EVERY TIMEok

    Sub CHANGE()
    Dim startPoint As Point3d
    Dim point As Point3d, point2 As Point3d
    Dim lngTemp As Long

    ' Start a command
    CadInputQueue.SendCommand "CHOOSE ELEMENT"

    ' Coordinates are in master units
    startPoint.X = 0.850813363321741
    startPoint.Y = 1.26048427622663E-02
    startPoint.Z = 0#

    ' Send a data point to the current command
    point.X = startPoint.X
    point.Y = startPoint.Y
    point.Z = startPoint.Z
    CadInputQueue.SendDataPoint point, 1

    point.X = startPoint.X + 0.168345907741465
    point.Y = startPoint.Y - 4.30446269439775E-03
    point.Z = startPoint.Z
    CadInputQueue.SendDataPoint point, 1

    ' Set a variable associated with a dialog box
    SetCExpressionValue "powerSelectInfo.prefs.currSelBy", 0, "PSELECT"

    CadInputQueue.SendCommand "POWERSELECTOR SINGLE"

    point.X = startPoint.X - 2.65327789375136E-03
    point.Y = startPoint.Y + 1.83168625293566E-04
    point.Z = startPoint.Z
    CadInputQueue.SendDataPoint point, 1

    point.X = startPoint.X - 2.65327789375136E-03
    point.Y = startPoint.Y + 1.83168625293566E-04
    point.Z = startPoint.Z
    CadInputQueue.SendDataPoint point, 1

    Dim modalHandler As New Macro1ModalHandler
    AddModalDialogEventsHandler modalHandler

    ' The following statement opens modal dialog "Edit Tags [SEEDS2TBLK]"

    ' Send a keyin that can be a command string
    CadInputQueue.SendKeyin "edit tags"

    CadInputQueue.SendKeyin "choose element"

    point.X = startPoint.X + 2.87285951254457E-02
    point.Y = startPoint.Y - 8.79209401408909E-03
    point.Z = startPoint.Z
    CadInputQueue.SendDataPoint point, 1

    point.X = startPoint.X + 2.87285951254457E-02
    point.Y = startPoint.Y - 8.79209401408909E-03
    point.Z = startPoint.Z
    CadInputQueue.SendDataPoint point, 1

    ' The following statement opens modal dialog "Edit Tags [SEEDS2TBLK]"

    CadInputQueue.SendKeyin "edit tags"

    CadInputQueue.SendKeyin "choose element"

    point.X = startPoint.X + 1.49916736164175E-02
    point.Y = startPoint.Y - 1.47319908628934E-02
    point.Z = startPoint.Z
    CadInputQueue.SendDataPoint point, 1

    point.X = startPoint.X + 1.49916736164175E-02
    point.Y = startPoint.Y - 1.47319908628934E-02
    point.Z = startPoint.Z
    CadInputQueue.SendDataPoint point, 1

    ' The following statement opens modal dialog "Edit Tags [SEEDS2TBLK]"

    CadInputQueue.SendKeyin "edit tags"

    CadInputQueue.SendKeyin "choose element"

    point.X = startPoint.X + 2.31475623144514E-02
    point.Y = startPoint.Y - 4.04802661898686E-02
    point.Z = startPoint.Z
    CadInputQueue.SendDataPoint point, 1

    point.X = startPoint.X + 2.31475623144514E-02
    point.Y = startPoint.Y - 4.04802661898686E-02
    point.Z = startPoint.Z
    CadInputQueue.SendDataPoint point, 1

    ' The following statement opens modal dialog "Edit Tags [SEEDS2TBLK]"

    CadInputQueue.SendKeyin "edit tags"

    point.X = startPoint.X + 0.031303451012485
    point.Y = startPoint.Y - 3.90149171875204E-02
    point.Z = startPoint.Z
    CadInputQueue.SendDataPoint point, 1

    point.X = startPoint.X + 4.42692227888464E-02
    point.Y = startPoint.Y - 3.90149171875204E-02
    point.Z = startPoint.Z
    CadInputQueue.SendDataPoint point, 1

    RemoveModalDialogEventsHandler modalHandler
    CommandState.StartDefaultCommand
    End Sub

    do you know any solution to my first question please

    1.changing multiple sheets numbers which are in tags  using VBA?

    Page numbers are in series 1,2,3---in tags?

  • do you know any solution to my first question

    One question at a time, please!

     
    Regards, Jon Summers
    LA Solutions

  • Sorry please check the code and screenshot i have add to my previous reply

  • Dim modalHandler As New Macro1ModalHandler

    You will find that the macro recorder has created a class module named Macro1ModalHandler.  Please post that code.

     
    Regards, Jon Summers
    LA Solutions

  • This one ?

    Implements IModalDialogEvents
    Private Sub IModalDialogEvents_OnDialogClosed(ByVal DialogBoxName As String, ByVal DialogResult As MsdDialogBoxResult)

    End Sub

    Private Sub IModalDialogEvents_OnDialogOpened(ByVal DialogBoxName As String, DialogResult As MsdDialogBoxResult)

    If DialogBoxName = "Edit Tags [SEEDS2TBLK]" Then

    CadInputQueue.SendKeyin "TAGJOURNAL EDIT TAG TITLE_1"

    CadInputQueue.SendKeyin "TAGJOURNAL EDIT VALUE 123456"

    ' Remove the following line to let the user close the dialog box.
    DialogResult = msdDialogBoxResultOK

    End If ' Edit Tags [SEEDS2TBLK]

    If DialogBoxName = "Edit Tags [SEEDS2TBLK]" Then

    CadInputQueue.SendKeyin "TAGJOURNAL EDIT TAG TITLE_2"

    CadInputQueue.SendKeyin "TAGJOURNAL EDIT VALUE 78910"

    CadInputQueue.SendKeyin "TAGJOURNAL EDIT TAG TITLE_1"

    CadInputQueue.SendKeyin "TAGJOURNAL EDIT VALUE 11121314"

    ' Remove the following line to let the user close the dialog box.
    DialogResult = msdDialogBoxResultOK

    End If ' Edit Tags [SEEDS2TBLK]

    If DialogBoxName = "Edit Tags [SEEDS2TBLK]" Then

    CadInputQueue.SendKeyin "TAGJOURNAL EDIT TAG TITLE_3"

    CadInputQueue.SendKeyin "TAGJOURNAL EDIT VALUE 111213141516"

    ' Remove the following line to let the user close the dialog box.
    DialogResult = msdDialogBoxResultOK

    End If ' Edit Tags [SEEDS2TBLK]

    If DialogBoxName = "Edit Tags [SEEDS2TBLK]" Then

    CadInputQueue.SendKeyin "TAGJOURNAL EDIT TAG DRAWING_NO"

    CadInputQueue.SendKeyin "TAGJOURNAL EDIT VALUE 123456"

    ' Remove the following line to let the user close the dialog box.
    DialogResult = msdDialogBoxResultOK

    End If ' Edit Tags [SEEDS2TBLK]

    End Sub

  • ' Remove the following line to let the user close the dialog box.
    DialogResult = msdDialogBoxResultOK

    You can see that you must edit the file if you want to change the behaviour.  The default behaviour is that the dialog should close automatically, without the need to click the OK button.  Investigate your code to find out why the dialog doesn't work the way you want.

    You need to step through your code using VBA's debug tools.  Function key F8 lets you step through your code.

     
    Regards, Jon Summers
    LA Solutions

  • Sorry i didn't get you.  can you make changes in code and paste it over here so i can know clearly please

  • can you make changes in code

    No!  I haven't suggested that you make any changes.  What I wrote was: You need to step through your code using VBA's debug tools.  Function key F8 lets you step through your code.

     
    Regards, Jon Summers
    LA Solutions

  • I tried but it didn't work for me. still waiting for someone solution to my problem. if anyone now please help me with this thanks