ActiveX textBox : value doesn't show after programatically changing the value

P

Philippe

Hi,

I've a quite strange problem.
A VBScript in an Outlook form, opens an Excel WorkBook containing on a
sheet, several Active X Controls.
The script adds the name of the contact in the ActiveX TextBox Control : the
fields value and text are actually modified as a result.
But, the displayed control doesn't show the value !

Does any one has any idea how to solve this issue ?

Thanks for reading,
Philippe

----------------------------
Sub exportVersExcel_Click()

Set objExcelApp = Application.CreateObject("Excel.Application")
Set objExcelBook = objExcelApp.Workbooks.Open _
("\\Server03\annuaire\Demande_Ouverture_Compte.xls")
Set objExcelSheet = objExcelBook.Sheets("DemandeOuverture")
objExcelSheet.Activate


Set objTextBox_NomBenef = objExcelSheet.OLEObjects("TextBox_NomBenef")
objTextBox_NomBenef.Object.value = Item.LastName

objExcelApp.Application.Visible = True

End Sub
-------------------------------
 
P

Philippe

Update :

If the control is .Activate before changing its value, then the value will
be displayed.
Which means that one have to add one line for each control, and activate
every single control in turn
It seems a bit crazy to have to do this, but it's what I'm gonna do for it
works.
If anyone has a better idea, it would still be interesting.

Thanks,
Philippe
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top