hexagon logo

PC-Dmis to Excel, through PC-Dmis Script

I know there is currently a VB project that runs in Excel during execution that will pull information into the workbook during execution. I decided to venture out and try some of my own approaches with a combination of data I found online here and there.

What I have is a script that can be executed in program, without too much setup and hassle, that will export data into an excel workbook like a print command would. I feel this script offers a little more versatility.

I will not claim ownership of this program. I just tweaked it to fit my needs. So far I have it running, and it works quite well.

I will answer what questions I can, but for the most part I wanted to post it to have as a reference.

It's a long program........
Parents
  • For every place where a GETTEXT-result is compared to a "text" you need to verify the German translation of that text. Like in

    ReportDim = Cmd.GetText(OUTPUT_TYPE, 0)
                  If ReportDim = "BOTH" Or ReportDim = "REPORT" Then
    


    For Swedish, the "BOTH" should be "BÅDA" and "REPORT" should be "RAPPORT", my guess for German is "BEIDE" and "RAPPORT".

    I often write scripts that work both in English and Swedish, the above excerpt would then be changed to

    ReportDim = Cmd.GetText(OUTPUT_TYPE, 0)
                  If ReportDim = "BOTH" Or ReportDim = "REPORT" Or ReportDim = "BÅDA" or ReportDim = "RAPPORT" Then
    


    which gets rather unwieldy when more languages are needed.


    In the latest versions of PC-DMIS there is a function for getting a string in the current language, given the English word,

    ASSIGN/V1=GETSETTING("Langstr(Yes)")


    will give "JA" when I run in Swedish, but this function is very limited in its vocabulary, and "BOTH" is not there Disappointed so you have to use a numeric ID instead - good luck finding the numbers, there are about 10000 different ones (-4000 to +6000, approx.)...
Reply
  • For every place where a GETTEXT-result is compared to a "text" you need to verify the German translation of that text. Like in

    ReportDim = Cmd.GetText(OUTPUT_TYPE, 0)
                  If ReportDim = "BOTH" Or ReportDim = "REPORT" Then
    


    For Swedish, the "BOTH" should be "BÅDA" and "REPORT" should be "RAPPORT", my guess for German is "BEIDE" and "RAPPORT".

    I often write scripts that work both in English and Swedish, the above excerpt would then be changed to

    ReportDim = Cmd.GetText(OUTPUT_TYPE, 0)
                  If ReportDim = "BOTH" Or ReportDim = "REPORT" Or ReportDim = "BÅDA" or ReportDim = "RAPPORT" Then
    


    which gets rather unwieldy when more languages are needed.


    In the latest versions of PC-DMIS there is a function for getting a string in the current language, given the English word,

    ASSIGN/V1=GETSETTING("Langstr(Yes)")


    will give "JA" when I run in Swedish, but this function is very limited in its vocabulary, and "BOTH" is not there Disappointed so you have to use a numeric ID instead - good luck finding the numbers, there are about 10000 different ones (-4000 to +6000, approx.)...
Children
No Data