Bentley Communities
Bentley Communities
  • Site
  • User
  • Site
  • Search
  • User
  • Welcome
  • Products
  • Support
  • About
  • More
  • Cancel
MicroStation Programming
  • Product Communities
  • Developers and Programming
  • MicroStation Programming
  • More
  • Cancel
MicroStation Programming
MicroStation Programming - Wiki Migrating VBA to CONNECT
    • Sign in
    • MicroStation Programming - Wiki
    • -MicroStation CONNECT Edition
      • +MicroStation SDK
      • +MicroStation MDL
      • +MicroStation VBA
      • -Training
        • +Common Topics
        • Customizing and Programming MicroStation CONNECT
        • -Developers Migrating to MicroStation CONNECT
          • Migrating VBA to CONNECT
          • Migrating BASIC to CONNECT
          • Migrating FAQ
          • +Workflows
          • Migrating Topics
        • Getting Started with Managed APIs
        • +Managed (C#) - Step By Step Guide
        • MicroStation CONNECT Developer Training
        • +Native (C++) - Step By Step Guide
      • +Code Examples and Utilities
      • +Code Snippets
    • +MicroStation V8

     
     Questions about this article, topic, or product? Click here. 

    Migrating VBA to CONNECT

    Content related to migrating MicroStation VBA customizations to MicroStation CONNECT.

    The MicroStation CONNECT VBA help file (..\MicroStationVBA.chm) provides a few topics that we recommend looking at first:

    1. "Changes for 64-bit Processes"
    2. "MicroStation VBA Environment Variables"
    3. "Calling DLL functions from VBA"

    The following items allow you to view notes specific to various VBA API areas:

    Architecture
    • Microsoft
      • 64-Bit Visual Basic for Applications Overview (General changes)
      • Compatibility Between the 32-bit and 64-bit Versions of Office (Microsoft ActiveX Control recommendations for 64-bit)
      • ActiveX Control File Names (Legacy 32-bit file names and descriptions)
      • Microsoft Visual Basic 6.0 Common Controls (Legacy download location)
    • Bentley
      • Migration from VBA 6.x to VBA 7.x

    Best Practices
    1. Determine if a Customization Needed
      Check existing Product Features, Workflows and Utilities to leverage first. If none exist and important enough consider submit a forum Idea or, filing a Enhancement Request with the product support team.  Lastly, identify the most appropriate API and determine if it permits you to fulfill the requirements.
    2. Compile your VBA Projects
      Microsoft VBA projects whether saved as for MicroStation VBA (.MVBA files) or Microsoft VBA (Supported Office file formats, or other 3rd party software vendors of VBA engine) all have the potential to cache binary changes from the client computer where the VBA project developer last modified a file. These changes can be subtle version differences from one computer to the next (and not update), show as missing references (not registered or blacklisted controls), or introduce subtle and/or strange behaviors; like: I made changes yet can't see them occuring, objects not created that should be, debugging not entering break points, etc.  In every case it is best to ensure every Class, Form, and Modules has 'Option Explicit as the first line of code and then attempt to Debug > Compile <ProjectName>.  This can most likely identify problems the developer environment may be hiding to to "binary project caching issues".  Typically, once each previously unaddressed error is corrected the project may return to normal.  When in doubt, Export all Class, Form, and Modules from your Project and import them into a brand new Project - add/link available installed Reference modules as needed, test and deploy for user acceptance feedback.
    3. Branch your Source Code
      When significant migration efforts are required it is best to make sure the old code is as stable and clean as possible before migrating to the new platform. Once your old code compiles cleanly helping resolve underlying undefined behaviors (anomalies) make a copy of that code to a new location that you plan is only intended for that software product and not be "shared" between product versions again.  This will help ensure your coding efforts should provide a cleaner implementation of code is moved or created forward.  Cleaner code is more easy to rationalize and debug for you and other developers on the project.
    Configuration
    • MicroStation VBA Configuration Variables
    • Customizing MicroStation with Visual Basic (VBA Help)
    • Bentley Macro Recorder (New to CONNECT)
    Coordinate Units Some methods may require UOR input vs. Master Unit values, though most should take Master Unit values.  These will likely be corrected in future releases when found.
    • Recommend: To provide Point in UORs multiply (or scale) master unit point values (X,Y and Z) respectively using: ActiveModelReference.UORsPerMasterUnit.
    • Known Issues: GetFloodBoundary (Defect 541573, Resolved in Update 11)
    Database
    • Microsoft
      • Microsoft 32-bit ODBC Data Source connections will required 64-bit ODBC to be Created and Verified.
    • Bentley
      • Connecting to Databases > Connecting to ODBC
    Load and Run VBA Macros
    • To Load and Run a VBA Macro
    • To Load and Run a VBA Macro Using a Key-in
    • VBA Projects Dialog
    Security
    • Determine if your MicroStation VBA Project requires running in a High Security mode. See: Security Configuration Variables:

      MS_SECURITY_LEVEL   : System         = NONE  
      MS_SECURITY_SPC     : System         = C:\ProgramData\Bentley\CONNECT Edition\Configuration\Organization\SPC\*.cer  
    Text
    • Known Issues
    TroubleShooting
    • See: MicroStation VBA Troubleshooting
    • Migrating-MVBA
    • Share
    • History
    • More
    • Cancel
    • Robert Hook Created by Bentley Colleague Robert Hook
    • When: Wed, Jul 10 2019 2:23 PM
    • Robert Hook Last revision by Bentley Colleague Robert Hook
    • When: Tue, Sep 8 2020 5:03 PM
    • Revisions: 7
    • Comments: 0
    Recommended
    Related
    Communities
    • Home
    • Getting Started
    • Community Central
    • Products
    • Support
    • Secure File Upload
    • Feedback
    Support and Services
    • Home
    • Product Support
    • Downloads
    • Subscription Services Portal
    Training and Learning
    • Home
    • About Bentley Institute
    • My Learning History
    • Reference Books
    Social Media
    •    LinkedIn
    •    Facebook
    •    Twitter
    •    YouTube
    •    RSS Feed
    •    Email

    © 2021 Bentley Systems, Incorporated  |  Contact Us  |  Privacy |  Terms of Use  |  Cookies