[V8i VBA] Open Excel Workbook from ProjectWise Location

Hello,

How would I go about defining  the location of an excel file in ProjectWise so I can open it from MicroStation in VBA?  I currently have a userform that has a text box that users enter the excel file location manually (tbWBLocation).  See the inserted code for more.

Thanks,

   'Get an Excel workbook
   Dim oWorkbook As Excel.Workbook
    'this removes the extra quotes from the file location
   tbWBLocation = Replace(tbWBLocation, """", "")
    'tests if file exists
    If FileExists(tbWBLocation.Text) = False Then
        GoTo WBLocation_NOT_FOUND
    End If
   Set oWorkbook = oExcel.Workbooks.Open(tbWBLocation.Text)

  • Hi Joey,

    I recommend to move your question to ProjectWise Programming forum (use More > Move tool).

    MicroStation does not provide any API to cooperate with ProjectWise, especially when it's even not design file but Excel file, so in my opinion it will be better to ask in ProjectWise community what API to use. When it will be clear, maybe further step - to discuss how such API call from MicroStation environment - will be necessary. But at first it has to be clear what ProjectWise API should be used.

    With regards,

      Jan

  • You need to create a COM or ActiveX DLL for the ProjectWise functionality.

    it should have one function to:

    Initallize,  log in, locate the document (from the arguments passed), check-out or copy-out the document log out, and return the local location of the document.

    (The functions to check-out and copy out return the local path to the document.)

    and one function to clean up

    initialize, log in, locate the document (from arguments passed), either Check-In or purge Copy out, then log out.

    (These functions will remove the local copy).

    These functions could then be called by your MVBA to be able to access the excel file.