Filling Excel Sheet Via OLE

Filling Excel Sheet Via OLE

Postby byron.hopp » 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
byron.hopp
 
Posts: 382
Joined: Sun Nov 06, 2005 3:55 pm
Location: Southern California, USA

Re: Filling Excel Sheet Via OLE

Postby Antonio Linares » 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: Select all  Expand view
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
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Filling Excel Sheet Via OLE

Postby byron.hopp » Thu Feb 02, 2023 1:37 pm

Thank you, I Googled for a couple of hours and never found this information.
Thanks,
Byron Hopp
Matrix Computer Services
byron.hopp
 
Posts: 382
Joined: Sun Nov 06, 2005 3:55 pm
Location: Southern California, USA


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 103 guests