Page 1 of 1
Filling Excel Sheet Via OLE
Posted: Thu Feb 02, 2023 12:53 am
by byron.hopp
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.
Re: Filling Excel Sheet Via OLE
Posted: Thu Feb 02, 2023 11:34 am
by Antonio Linares
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
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
Re: Filling Excel Sheet Via OLE
Posted: Thu Feb 02, 2023 1:37 pm
by byron.hopp
Thank you, I Googled for a couple of hours and never found this information.