Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 413
Default ActiveX Textbox question

I create an ActiceX Textbox, with wraptext, Tab key and
Enter key enabled.
When I enter text data, the layout in the textbox is fine.
However when I delete the box it all goes haywire...........
that's to say the first cell's rowheight increases to match
the overall 'height' of the textbox, and all the data is in one
column.

Can I preserve the data layout, when the box is deleted
please?
In addition, there are little square 'box' characters amongst
the data. Why is this please?

Here's the kindly given delete code:

With ActiveWorkbook.Sheets("Contract Master Order")
.Unprotect Password:="SGB"
.Cells.Locked = False
Dim oleObj As OLEObject
Dim rng As Range
For Each oleObj In ActiveWorkbook.Sheets _
("Contract Master Order").OLEObjects
If TypeOf oleObj.Object Is MSForms.TextBox Then
Set rng = oleObj.TopLeftCell
rng.Value = oleObj.Object.Value
oleObj.Delete
End If
Next
End With

Regards.


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.716 / Virus Database: 472 - Release Date: 05/07/2004


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default ActiveX Textbox question

With ActiveWorkbook.Sheets("Contract Master Order")
.Unprotect Password:="SGB"
.Cells.Locked = False
Dim oleObj As OLEObject
Dim rng As Range
For Each oleObj In ActiveWorkbook.Sheets _
("Contract Master Order").OLEObjects
If TypeOf oleObj.Object Is MSForms.TextBox Then
Set rng = oleObj.TopLeftCell
rng.Value = application.Substitute( _
oleObj.Object.Value,chr(13),"")
oleObj.Delete
End If
Next
End With


If the cell width approximates the textbox width and the height the height
and wordwrap is on, then you should get about the same result.

--
Regards,
Tom Ogilvy


"Stuart" wrote in message
...
I create an ActiceX Textbox, with wraptext, Tab key and
Enter key enabled.
When I enter text data, the layout in the textbox is fine.
However when I delete the box it all goes haywire...........
that's to say the first cell's rowheight increases to match
the overall 'height' of the textbox, and all the data is in one
column.

Can I preserve the data layout, when the box is deleted
please?
In addition, there are little square 'box' characters amongst
the data. Why is this please?

Here's the kindly given delete code:

With ActiveWorkbook.Sheets("Contract Master Order")
.Unprotect Password:="SGB"
.Cells.Locked = False
Dim oleObj As OLEObject
Dim rng As Range
For Each oleObj In ActiveWorkbook.Sheets _
("Contract Master Order").OLEObjects
If TypeOf oleObj.Object Is MSForms.TextBox Then
Set rng = oleObj.TopLeftCell
rng.Value = oleObj.Object.Value
oleObj.Delete
End If
Next
End With

Regards.


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.716 / Virus Database: 472 - Release Date: 05/07/2004




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 413
Default ActiveX Textbox question

Many thanks.

If the textbox has to 'match' the cell (height, width etc)
then I'm looking for some other way, I think.

Regards.

"Tom Ogilvy" wrote in message
...
With ActiveWorkbook.Sheets("Contract Master Order")
.Unprotect Password:="SGB"
.Cells.Locked = False
Dim oleObj As OLEObject
Dim rng As Range
For Each oleObj In ActiveWorkbook.Sheets _
("Contract Master Order").OLEObjects
If TypeOf oleObj.Object Is MSForms.TextBox Then
Set rng = oleObj.TopLeftCell
rng.Value = application.Substitute( _
oleObj.Object.Value,chr(13),"")
oleObj.Delete
End If
Next
End With


If the cell width approximates the textbox width and the height the height
and wordwrap is on, then you should get about the same result.

--
Regards,
Tom Ogilvy


"Stuart" wrote in message
...
I create an ActiceX Textbox, with wraptext, Tab key and
Enter key enabled.
When I enter text data, the layout in the textbox is fine.
However when I delete the box it all goes haywire...........
that's to say the first cell's rowheight increases to match
the overall 'height' of the textbox, and all the data is in one
column.

Can I preserve the data layout, when the box is deleted
please?
In addition, there are little square 'box' characters amongst
the data. Why is this please?

Here's the kindly given delete code:

With ActiveWorkbook.Sheets("Contract Master Order")
.Unprotect Password:="SGB"
.Cells.Locked = False
Dim oleObj As OLEObject
Dim rng As Range
For Each oleObj In ActiveWorkbook.Sheets _
("Contract Master Order").OLEObjects
If TypeOf oleObj.Object Is MSForms.TextBox Then
Set rng = oleObj.TopLeftCell
rng.Value = oleObj.Object.Value
oleObj.Delete
End If
Next
End With

Regards.


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.716 / Virus Database: 472 - Release Date: 05/07/2004






---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.716 / Virus Database: 472 - Release Date: 05/07/2004


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default ActiveX Textbox question

To me, you don't make any sense. If you want the cell to look the same as
the textbox, then how is the text going to wrap the same if the height and
width aren't the same? Don't bother to answer since your working with
Norman.

--
Regards,
Tom Ogilvy

"Stuart" wrote in message
...
Many thanks.

If the textbox has to 'match' the cell (height, width etc)
then I'm looking for some other way, I think.

Regards.

"Tom Ogilvy" wrote in message
...
With ActiveWorkbook.Sheets("Contract Master Order")
.Unprotect Password:="SGB"
.Cells.Locked = False
Dim oleObj As OLEObject
Dim rng As Range
For Each oleObj In ActiveWorkbook.Sheets _
("Contract Master Order").OLEObjects
If TypeOf oleObj.Object Is MSForms.TextBox Then
Set rng = oleObj.TopLeftCell
rng.Value = application.Substitute( _
oleObj.Object.Value,chr(13),"")
oleObj.Delete
End If
Next
End With


If the cell width approximates the textbox width and the height the

height
and wordwrap is on, then you should get about the same result.

--
Regards,
Tom Ogilvy


"Stuart" wrote in message
...
I create an ActiceX Textbox, with wraptext, Tab key and
Enter key enabled.
When I enter text data, the layout in the textbox is fine.
However when I delete the box it all goes haywire...........
that's to say the first cell's rowheight increases to match
the overall 'height' of the textbox, and all the data is in one
column.

Can I preserve the data layout, when the box is deleted
please?
In addition, there are little square 'box' characters amongst
the data. Why is this please?

Here's the kindly given delete code:

With ActiveWorkbook.Sheets("Contract Master Order")
.Unprotect Password:="SGB"
.Cells.Locked = False
Dim oleObj As OLEObject
Dim rng As Range
For Each oleObj In ActiveWorkbook.Sheets _
("Contract Master Order").OLEObjects
If TypeOf oleObj.Object Is MSForms.TextBox Then
Set rng = oleObj.TopLeftCell
rng.Value = oleObj.Object.Value
oleObj.Delete
End If
Next
End With

Regards.


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.716 / Virus Database: 472 - Release Date: 05/07/2004






---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.716 / Virus Database: 472 - Release Date: 05/07/2004




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
Excel ActiveX TextBox Question dhstein Excel Discussion (Misc queries) 4 January 29th 09 02:12 PM
Further ActiveX Control (TextBox) questions Stuart[_5_] Excel Programming 0 July 4th 04 05:19 PM
ActiveX Control (TextBox) question Stuart[_5_] Excel Programming 2 July 4th 04 12:37 PM
Question regarding an activex control button slim[_2_] Excel Programming 2 February 25th 04 04:00 PM
Dynamic TextBox ActiveX events Tom Ogilvy Excel Programming 0 September 29th 03 08:56 PM


All times are GMT +1. The time now is 01:31 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"