Close microstation through VBA

How can I script my Macro so that it closes microstation after the macro is done?

Best regards

Robert

Parents
  • I think that is close. The only variable I would need to fill out would be the save as location, correct? I highlighted it in yellow. It worked, but it saved my file as: Master Backup+drawing name.dgn
    If I do it without the last back slash, it doesn’t work.
     
    I need to do some research, I would ultimately like to make this save as like every 15 minutes. My remote office is on a VPN connection and this is the only temporary solution I can come up with because for some reason the MS_backup won’t save a .bak to my C drive. It is very odd.
     

    Sub Macro1()

    Dim myFile As String

    myFile = ActiveDesignFile.Name

    myFile = Left(myFile, Len(myFile) - 4)

    Application.ActiveDesignFile.SaveAs "C:\Users\cdebolt\Desktop\Cole Tools\Master Backup\" & myFile & ".dgn", False, msdDesignFileFormatDGN

    End Sub

     
Reply
  • I think that is close. The only variable I would need to fill out would be the save as location, correct? I highlighted it in yellow. It worked, but it saved my file as: Master Backup+drawing name.dgn
    If I do it without the last back slash, it doesn’t work.
     
    I need to do some research, I would ultimately like to make this save as like every 15 minutes. My remote office is on a VPN connection and this is the only temporary solution I can come up with because for some reason the MS_backup won’t save a .bak to my C drive. It is very odd.
     

    Sub Macro1()

    Dim myFile As String

    myFile = ActiveDesignFile.Name

    myFile = Left(myFile, Len(myFile) - 4)

    Application.ActiveDesignFile.SaveAs "C:\Users\cdebolt\Desktop\Cole Tools\Master Backup\" & myFile & ".dgn", False, msdDesignFileFormatDGN

    End Sub

     
Children
No Data