Skip to main content

Creating Microsoft Excel Green Triangle Indicator from COBOL

  • February 15, 2013
  • 0 replies
  • 0 views

Problem:

There is no property to invoke this piece of code in Visual Basic:

Application.ErrorCheckingOptions.BackgroundChecking = False

This is not documented in Visual Basic or in msexcel.cpy --> not defined.

This attribute turns off the 'Green Triangle Indicator' that one would see in the cell when one put a text in the cell preceded with a single quote symbol as in:  '12/12/04

Manualy, one can click 'Tools....  Options...  Error Checking Tab.'  Then, uncheck 'Enable background error checking'.

When recorded under a msexcel macro, one will see the visual basic code above.

Resolution:

Try the following:

       01 errorcheckoptions    object reference.

       01 backgroundchecking    object reference.

       procedure division.

      *>   Create a new instance of Microsoft Excel

           invoke MSExcel "new" returning ExcelObject

      *>   Make Excel visible

           invoke ExcelObject "setVisible" using by value 1

           invoke ExcelObject "getErrorCheckingOptions"

              returning errorcheckoptions

           end-invoke

           invoke errorcheckoptions "setBackgroundChecking"

              using by value 0

           end-invoke

Old KB# 1613

0 replies

Be the first to reply!