Skip to main content

How to translate following VBA(for EXCEL) to acuCOBOL grammar

  • January 22, 2013
  • 7 replies
  • 0 views

I am trying to check EXCEL language setting by following statement:

Application.LanguageSettings.LanguageID(msoLanguageIDUI)

 

But I am not sure how to accomplish this in ACUCOBOL grammar.

Anyone can help? Thanks in advance.

 

 


#Excel

7 replies

Stephen Hjerpe
  • Participating Frequently
  • 1100 replies
  • January 22, 2013

I am trying to check EXCEL language setting by following statement:

Application.LanguageSettings.LanguageID(msoLanguageIDUI)

 

But I am not sure how to accomplish this in ACUCOBOL grammar.

Anyone can help? Thanks in advance.

 

 


#Excel

Based on this MSDN article ... msdn.microsoft.com/.../aa190876(v=office.10).aspx the Application.LanguageSettings.LanguageID is a property that you can inquire on to get the Language classes that were / are used to install, user interface, and help.

Use Application.LanguageSettings.LanguagePreferredForEditing .. you would inquire Application.LanguageSettings.LanguagePreferredForEditing my-return and my-return would contain a LCID such as msoLanguageIDEnglishUS.


  • Author
  • Rocketeer
  • 19312 replies
  • January 23, 2013

I am trying to check EXCEL language setting by following statement:

Application.LanguageSettings.LanguageID(msoLanguageIDUI)

 

But I am not sure how to accomplish this in ACUCOBOL grammar.

Anyone can help? Thanks in advance.

 

 


#Excel

The code generated by "ActivX DEF Utility" is not always correct, but when i use the tool i get this example:

     *    This program is generated by AxDefTool.

     *    This is an example for the syntax of ActiveX.

     *    For more details, read the specific ActiveX Manual.

      special-names.

          copy "S:\\MUFFROHR\\ACU\\COPY\\excel.def".

          .

      working-storage section.

     *    Attention: The field definition may be different.

      77  H-_Application  handle of @_Application.

     *    returning: LanguageSettings*

      77  W-Var-LanguageSettings  handle.

      procedure division.

      main.

     *Create the ActiveX

          create @_Application

                     license-key " "

                     handle in H-_Application

                     .

     *Code for Property-Get

          inquire H-_Application  @LanguageSettings

                     in W-Var-LanguageSettings

          .


  • Author
  • Rocketeer
  • 19312 replies
  • January 23, 2013

I am trying to check EXCEL language setting by following statement:

Application.LanguageSettings.LanguageID(msoLanguageIDUI)

 

But I am not sure how to accomplish this in ACUCOBOL grammar.

Anyone can help? Thanks in advance.

 

 


#Excel

I create "excel12.def"(Microsoft Excel 12.0 Object Library(Ver 1.6)) using Tool "Axdefgen"

 "excel12.def" only include 

               PROPERTY-GET, 1801, @LanguageSettings
                       RETURNING "LanguageSettings*", TYPE 9

But I need to access "LanguageID" (Application.LanguageSettings.LanguageID(msoLanguageIDUI)).

So I realized that I should create "office12.def"

In office12.def, I find

               PROPERTY-GET, 1, @LanguageID,
                   "MsoAppLanguageID" @Id, TYPE 3
                       RETURNING "int", TYPE 22
      * LanguagePreferredForEditing
               PROPERTY-GET, 2, @LanguagePreferredForEditing,
                   "MsoLanguageID" @lid, TYPE 3
                       RETURNING "boolean", TYPE 11

But I don't know how to using acuCOBOL to access @office and these 2 properties @LanguageID/@LanguagePreferredForEditing?


  • Author
  • Rocketeer
  • 19312 replies
  • January 23, 2013

I am trying to check EXCEL language setting by following statement:

Application.LanguageSettings.LanguageID(msoLanguageIDUI)

 

But I am not sure how to accomplish this in ACUCOBOL grammar.

Anyone can help? Thanks in advance.

 

 


#Excel

I create "excel12.def"(Microsoft Excel 12.0 Object Library(Ver 1.6)) using Tool "Axdefgen"

 "excel12.def" only include 

               PROPERTY-GET, 1801, @LanguageSettings
                       RETURNING "LanguageSettings*", TYPE 9

But I need to access "LanguageID" (Application.LanguageSettings.LanguageID(msoLanguageIDUI)).

So I realized that I should create "office12.def"

In office12.def, I find

               PROPERTY-GET, 1, @LanguageID,
                   "MsoAppLanguageID" @Id, TYPE 3
                       RETURNING "int", TYPE 22
      * LanguagePreferredForEditing
               PROPERTY-GET, 2, @LanguagePreferredForEditing,
                   "MsoLanguageID" @lid, TYPE 3
                       RETURNING "boolean", TYPE 11

But I don't know how to using acuCOBOL to access @office and these 2 properties @LanguageID/@LanguagePreferredForEditing?


Stephen Hjerpe
  • Participating Frequently
  • 1100 replies
  • January 23, 2013

I am trying to check EXCEL language setting by following statement:

Application.LanguageSettings.LanguageID(msoLanguageIDUI)

 

But I am not sure how to accomplish this in ACUCOBOL grammar.

Anyone can help? Thanks in advance.

 

 


#Excel

CREATE  Application      OF Office                   HANDLE           IN my-office-handle

Inquire LanguageID MsoAppLanguageID in my-lang-handle

This inquire might be this Inquire LanguageID::MsoAppLanguageID in my-lang-handle


Stephen Hjerpe
  • Participating Frequently
  • 1100 replies
  • January 23, 2013

I am trying to check EXCEL language setting by following statement:

Application.LanguageSettings.LanguageID(msoLanguageIDUI)

 

But I am not sure how to accomplish this in ACUCOBOL grammar.

Anyone can help? Thanks in advance.

 

 


#Excel

I'm not sure the Office library provides an entry for you .. when I look at the def file there isn't a CLSID for Office, there are CLSID for some classes such as OfficeTheme .. * OfficeTheme

          CLASS @OfficeTheme

              CLSID, 000C03A0-0000-0000-C000-000000000046

              NAME, "OfficeTheme"

I can create this ... create OfficeTheme

              HANDLE IN my-office-handle.

however I don't think this loads the Language Classes.


  • Author
  • Rocketeer
  • 19312 replies
  • January 30, 2013

I am trying to check EXCEL language setting by following statement:

Application.LanguageSettings.LanguageID(msoLanguageIDUI)

 

But I am not sure how to accomplish this in ACUCOBOL grammar.

Anyone can help? Thanks in advance.

 

 


#Excel

I find what I need in excel.def:

           CLASS @XlApplicationInternational
               CLSID, 00000000-0000-0000-0000-000000000000
               NAME, "XlApplicationInternational"
      * "long xl24HourClock"
               ENUMERATOR, @xl24HourClock, 33
      * "long xl4DigitYears"
               ENUMERATOR, @xl4DigitYears, 43
      * "long xlAlternateArraySeparator"
               ENUMERATOR, @xlAlternateArraySeparator, 16
      * "long xlColumnSeparator"
               ENUMERATOR, @xlColumnSeparator, 14
      * "long xlCountryCode"
               ENUMERATOR, @xlCountryCode, 1
      * "long xlCountrySetting"
               ENUMERATOR, @xlCountrySetting, 2
      * "long xlCurrencyBefore"

 

How could I get @xlCountryCode value?

I tried following, but it failed.

    77 EX-APP            HANDLE OF Application.

   77 EX-COUNTRY-CODE PIC 9(08) VALUE ZEROS.

     CREATE @Application OF @Excel HANDLE IN EX-APP.
      INQUIRE EX-APP @XlApplicationInternational::xlCountryCode 
      IN EX-COUNTRY-CODE.