P
philippe
Hi !
I'm trying to copy data from an outlook form into an excel active x control.
I have a solution that allows me to write into an Excel Cell, which I
probably could get linked with the active x control, thus avoiding to have to
write directly into the control, but for some reason, i need to avoid that.
Please find my code below and tell me if you see any reason why it does
nothing.
I may not use the proper object to manipulate the active x control on the
excel sheet.
Or is it that there's no way to manipulate those control from outside Excel ?
Sub exportVersExcel_Click() 'vbs script on an outlook form
' creating object :
Set objExcelApp = Item.Application.CreateObject("Excel.Application")
objExcelApp.Workbooks.Open
"\\Server03\Annuaire\Demande_Ouverture_Compte.xls")
Set objExcelBook = objExcelApp.ActiveWorkbook
Set objExcelSheets = objExcelBook.Worksheets
Set objExcelSheet = objExcelBook.Sheets("DemandeOuverture")
objExcelSheet.Activate
' The two following lines will work :
objExcelSheet.range("J12").value = Item.LastName
objExcelSheet.range("J14").value = Item.FirstName
'Those two ones would work within excel, but don't seem to work in
automation :
objExcelSheet.OLEObjects("TextBox_NomBenef").Object.value = Item.LastName
objExcelSheet.OLEObjects("TextBox_PrenomBenef").Object.value = Item.FirstName
THANK YOU for reading me, hope you'll come up with a bright idea
Philippe
I'm trying to copy data from an outlook form into an excel active x control.
I have a solution that allows me to write into an Excel Cell, which I
probably could get linked with the active x control, thus avoiding to have to
write directly into the control, but for some reason, i need to avoid that.
Please find my code below and tell me if you see any reason why it does
nothing.
I may not use the proper object to manipulate the active x control on the
excel sheet.
Or is it that there's no way to manipulate those control from outside Excel ?
Sub exportVersExcel_Click() 'vbs script on an outlook form
' creating object :
Set objExcelApp = Item.Application.CreateObject("Excel.Application")
objExcelApp.Workbooks.Open
"\\Server03\Annuaire\Demande_Ouverture_Compte.xls")
Set objExcelBook = objExcelApp.ActiveWorkbook
Set objExcelSheets = objExcelBook.Worksheets
Set objExcelSheet = objExcelBook.Sheets("DemandeOuverture")
objExcelSheet.Activate
' The two following lines will work :
objExcelSheet.range("J12").value = Item.LastName
objExcelSheet.range("J14").value = Item.FirstName
'Those two ones would work within excel, but don't seem to work in
automation :
objExcelSheet.OLEObjects("TextBox_NomBenef").Object.value = Item.LastName
objExcelSheet.OLEObjects("TextBox_PrenomBenef").Object.value = Item.FirstName
THANK YOU for reading me, hope you'll come up with a bright idea
Philippe