hexagon logo

Open PCDMIS Program with a Hyperlink in Excel

So I just took on the daunting task of taking every single part that we measure ongoing capability on from physical files to excel files. Each file has the .PRG file for each part #. Now what I want to do is create a hyperlink in excel so that when the link is clicked it opens the specified program.

I can add the link. But when I click the link the program doesn't open. I get a spinning wheel like its trying to open it but then nothing. Is there any way to open .PRG files through excel? Any advise?
Parents
  • You can launch PC-DMIS with VBA in Excel. You will have to add the correct .dll or .tlb (can't remember that exactly) file into the object browser.

    The existing vbscript examples on this forum will be a big help if you choose this route, but note that VBA is different than VBscripts.

    I'm on a work computer so I dont have any examples to pass along at this moment, I'll try to remember to come back to this later on. If you search around here you might find some stuff in the meantime


    Thanks for the help. I have found a few examples but I am entirely 100% unfamiliar with how to actually make this work. What i have so far.


    ' Launch PC-Dmis by creating the app object
    Set app = CreateObject("PCDLRN.Application")

    If Not app.WaitUntilReady(300) Then
    MsgBox "Machine did not initialize, Exiting"
    Exit Sub
    End If
    'if you get here, the machine initialized successfuly

    ' Ask the App object for the partprograms object
    Set Parts = app.PartPrograms
    ' Ask the Partprograms object to display the file
    ' open dialog and return the opened part program object
    Set part = Parts.Open("C:\Program Files\WAI\PC-DMIS V42\ip1.prg", "OFFLINE") I changed this to match my files actual location

    app.Visible = True



    However I'm not really sure how to execute it. When I switch the drop down from (General) to Worksheet it says: Compile Error: Invalid outside procedure.
    I also saw that i need to configure excel to reference the "pcdlrn.tlb" file in my directory and I dont know how to do that.

    Any help would be greatly appreciated. I will keep playing with it and see if I can get anything to work. Ill update if I make any progress.

Reply
  • You can launch PC-DMIS with VBA in Excel. You will have to add the correct .dll or .tlb (can't remember that exactly) file into the object browser.

    The existing vbscript examples on this forum will be a big help if you choose this route, but note that VBA is different than VBscripts.

    I'm on a work computer so I dont have any examples to pass along at this moment, I'll try to remember to come back to this later on. If you search around here you might find some stuff in the meantime


    Thanks for the help. I have found a few examples but I am entirely 100% unfamiliar with how to actually make this work. What i have so far.


    ' Launch PC-Dmis by creating the app object
    Set app = CreateObject("PCDLRN.Application")

    If Not app.WaitUntilReady(300) Then
    MsgBox "Machine did not initialize, Exiting"
    Exit Sub
    End If
    'if you get here, the machine initialized successfuly

    ' Ask the App object for the partprograms object
    Set Parts = app.PartPrograms
    ' Ask the Partprograms object to display the file
    ' open dialog and return the opened part program object
    Set part = Parts.Open("C:\Program Files\WAI\PC-DMIS V42\ip1.prg", "OFFLINE") I changed this to match my files actual location

    app.Visible = True



    However I'm not really sure how to execute it. When I switch the drop down from (General) to Worksheet it says: Compile Error: Invalid outside procedure.
    I also saw that i need to configure excel to reference the "pcdlrn.tlb" file in my directory and I dont know how to do that.

    Any help would be greatly appreciated. I will keep playing with it and see if I can get anything to work. Ill update if I make any progress.

Children
No Data