Filling Excel Sheet Via OLE

Post Reply
byron.hopp
Posts: 388
Joined: Sun Nov 06, 2005 3:55 pm
Location: Southern California, USA
Contact:

Filling Excel Sheet Via OLE

Post 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.
Thanks,
Byron Hopp
Matrix Computer Services
User avatar
Antonio Linares
Site Admin
Posts: 42273
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Filling Excel Sheet Via OLE

Post 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
 
regards, saludos

Antonio Linares
www.fivetechsoft.com
byron.hopp
Posts: 388
Joined: Sun Nov 06, 2005 3:55 pm
Location: Southern California, USA
Contact:

Re: Filling Excel Sheet Via OLE

Post by byron.hopp »

Thank you, I Googled for a couple of hours and never found this information.
Thanks,
Byron Hopp
Matrix Computer Services
Post Reply