Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Change Value Active X control

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").Objec t.value = Item.LastName
objExcelSheet.OLEObjects("TextBox_PrenomBenef").Ob ject.value = Item.FirstName

THANK YOU for reading me, hope you'll come up with a bright idea
Philippe
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 56
Default Change Value Active X control

Hi,

I don't do much of this controlling one thing from another, but wouldn't
this work:

objExcelSheet.NomBenef.Text = Item.LastName
objExcelSheet.PrenomBenef.Text = Item.FirstName

You might try just swapping .Value for .Text in your original code, that may
work too.

Jeff

"philippe" wrote in message
...
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").Objec t.value = Item.LastName
objExcelSheet.OLEObjects("TextBox_PrenomBenef").Ob ject.value =
Item.FirstName

THANK YOU for reading me, hope you'll come up with a bright idea
Philippe



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 67
Default Change Value Active X control

Hi
See my answer to your post in public.fr.excel

HTH
Cordially
Pascal

"philippe" a écrit dans le message de
news: ...
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").Objec t.value = Item.LastName
objExcelSheet.OLEObjects("TextBox_PrenomBenef").Ob ject.value =
Item.FirstName

THANK YOU for reading me, hope you'll come up with a bright idea
Philippe



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Change Value Active X control

Thank you for your answer.
I tried your proposition, just in case it may work,
but i've unfortunately not been surprised that it doesn't.

Thank you anyway,
I keep searching

"Jeff Standen" a écrit :

Hi,

I don't do much of this controlling one thing from another, but wouldn't
this work:

objExcelSheet.NomBenef.Text = Item.LastName
objExcelSheet.PrenomBenef.Text = Item.FirstName

You might try just swapping .Value for .Text in your original code, that may
work too.

Jeff

"philippe" wrote in message
...
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").Objec t.value = Item.LastName
objExcelSheet.OLEObjects("TextBox_PrenomBenef").Ob ject.value =
Item.FirstName

THANK YOU for reading me, hope you'll come up with a bright idea
Philippe




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
ACTIVE X CONTROL? Jase Excel Discussion (Misc queries) 1 May 9th 08 12:49 AM
Difference between a Forms Control verus Active-X Control funGT350 Excel Discussion (Misc queries) 6 May 6th 08 11:20 PM
how to set active x control sharlie Excel Discussion (Misc queries) 0 March 30th 06 01:27 AM
Active X Control Help Grant Excel Programming 3 November 2nd 04 09:14 PM
Tool Tip Text for Form control/ Active-X control Freddie[_2_] Excel Programming 0 October 19th 04 04:14 AM


All times are GMT +1. The time now is 02:05 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"