FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Filling Excel Sheet Via OLE
Posts: 408
Joined: Sun Nov 06, 2005 03:55 PM
Filling Excel Sheet Via OLE
Posted: Thu Feb 02, 2023 12:53 AM

I am filling out an Excel document provided to me from a Government entity. This sheet performs many validations and calculations upon entering the data. When I fill out the sheet via OLE it does not seem to trigger the validation or calculations, but if I open it and type an additional line it behaves correctly. When a Cell is associated to a combo box can the programmer manipulate the combox via OLE, and how is it detected.

Thanks,

Byron Hopp

Matrix Computer Services
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: Filling Excel Sheet Via OLE
Posted: Thu Feb 02, 2023 11:34 AM
Dear Byron,

Asking chatGPT about it: https://chat.openai.com/chat
Yes, you can manipulate a combobox associated with a cell in an Excel sheet through OLE (Object Linking and Embedding). You can do this by using a programming language that supports OLE automation, such as VBA or Visual Basic, to access and modify the properties of the combobox object in the Excel document.

To detect if a cell is associated with a combobox through OLE, you can check the cell's ValidationType property. If the value of this property is set to xlValidateList, it indicates that the cell is associated with a combobox.

For example, in VBA you can use the following code to detect if a cell is associated with a combobox:
Code (fw): Select all Collapse
Sub CheckCellValidationType()
  Dim c As Range
  Set c = ActiveCell
  If c.Validation.Type = xlValidateList Then
    MsgBox "The selected cell is associated with a combobox."
  Else
    MsgBox "The selected cell is not associated with a combobox."
  End If
End Sub
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 408
Joined: Sun Nov 06, 2005 03:55 PM
Re: Filling Excel Sheet Via OLE
Posted: Thu Feb 02, 2023 01:37 PM

Thank you, I Googled for a couple of hours and never found this information.

Thanks,

Byron Hopp

Matrix Computer Services

Continue the discussion