Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 54
Default Data type not defined


The following code comes from excel 2007 help

Dim MyData as DataObject

Private Sub CommandButton1_Click()
'Need to select text before copying it to Clipboard
TextBox1.SelStart = 0
TextBox1.SelLength = TextBox1.TextLength
TextBox1.Copy

MyData.GetFromClipboard
TextBox2.Text = MyData.GetText(1)
End Sub

Private Sub UserForm_Initialize()
Set MyData = New DataObject
TextBox1.Text = "Move this data to the " _
& "Clipboard, to a DataObject, then to "
& "TextBox2!"
End Sub

The macro fails on the DIM statement indicating that it cannot find that
data type. Is this a non-standard data type or does it originate from other
add-ons

TIA for any clues on building/finding it

--
Ken
"Started with Visicalc in 82"
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Data type not defined


You would have tried pasting the code in one of the modules..Within VBE from
the left tree view; right click MicrosoftExcelObject and Insert a Userform.
Then from the toolbox drag two textbox controls and a command button control.
Right click on the icon userform1 and view code..and then paste the code and
try

PS: This will reference to MicrosoftForms x.0 Object library...

If this post helps click Yes
---------------
Jacob Skaria


"K_Macd" wrote:

The following code comes from excel 2007 help

Dim MyData as DataObject

Private Sub CommandButton1_Click()
'Need to select text before copying it to Clipboard
TextBox1.SelStart = 0
TextBox1.SelLength = TextBox1.TextLength
TextBox1.Copy

MyData.GetFromClipboard
TextBox2.Text = MyData.GetText(1)
End Sub

Private Sub UserForm_Initialize()
Set MyData = New DataObject
TextBox1.Text = "Move this data to the " _
& "Clipboard, to a DataObject, then to "
& "TextBox2!"
End Sub

The macro fails on the DIM statement indicating that it cannot find that
data type. Is this a non-standard data type or does it originate from other
add-ons

TIA for any clues on building/finding it

--
Ken
"Started with Visicalc in 82"

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 54
Default Data type not defined


The code was just a wider example - what I was trying to achieve is test for
an empty/filled clipboard and had hoped to use the following elements

Dim MyData as DataObject
MyData.GetFromClipboard
Text = MyData.GetText(1)

_ TestClip = IIf(IsEmpty(Text), False, True)

Is DataObject a data type that only accompanies a User Form or is there
another way to interegate the clipboard? I also suspect that GetFromClipboard
may be a method that is not available outside the form container

Thanks

--
Ken
"Started with Visicalc in 82"


"Jacob Skaria" wrote:

You would have tried pasting the code in one of the modules..Within VBE from
the left tree view; right click MicrosoftExcelObject and Insert a Userform.
Then from the toolbox drag two textbox controls and a command button control.
Right click on the icon userform1 and view code..and then paste the code and
try

PS: This will reference to MicrosoftForms x.0 Object library...

If this post helps click Yes
---------------
Jacob Skaria


"K_Macd" wrote:

The following code comes from excel 2007 help

Dim MyData as DataObject

Private Sub CommandButton1_Click()
'Need to select text before copying it to Clipboard
TextBox1.SelStart = 0
TextBox1.SelLength = TextBox1.TextLength
TextBox1.Copy

MyData.GetFromClipboard
TextBox2.Text = MyData.GetText(1)
End Sub

Private Sub UserForm_Initialize()
Set MyData = New DataObject
TextBox1.Text = "Move this data to the " _
& "Clipboard, to a DataObject, then to "
& "TextBox2!"
End Sub

The macro fails on the DIM statement indicating that it cannot find that
data type. Is this a non-standard data type or does it originate from other
add-ons

TIA for any clues on building/finding it

--
Ken
"Started with Visicalc in 82"

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Data type not defined

Refer

http://www.cpearson.com/excel/Clipboard.aspx

If this post helps click Yes
---------------
Jacob Skaria


"K_Macd" wrote:

The code was just a wider example - what I was trying to achieve is test for
an empty/filled clipboard and had hoped to use the following elements

Dim MyData as DataObject
MyData.GetFromClipboard
Text = MyData.GetText(1)

_ TestClip = IIf(IsEmpty(Text), False, True)

Is DataObject a data type that only accompanies a User Form or is there
another way to interegate the clipboard? I also suspect that GetFromClipboard
may be a method that is not available outside the form container

Thanks

--
Ken
"Started with Visicalc in 82"


"Jacob Skaria" wrote:

You would have tried pasting the code in one of the modules..Within VBE from
the left tree view; right click MicrosoftExcelObject and Insert a Userform.
Then from the toolbox drag two textbox controls and a command button control.
Right click on the icon userform1 and view code..and then paste the code and
try

PS: This will reference to MicrosoftForms x.0 Object library...

If this post helps click Yes
---------------
Jacob Skaria


"K_Macd" wrote:

The following code comes from excel 2007 help

Dim MyData as DataObject

Private Sub CommandButton1_Click()
'Need to select text before copying it to Clipboard
TextBox1.SelStart = 0
TextBox1.SelLength = TextBox1.TextLength
TextBox1.Copy

MyData.GetFromClipboard
TextBox2.Text = MyData.GetText(1)
End Sub

Private Sub UserForm_Initialize()
Set MyData = New DataObject
TextBox1.Text = "Move this data to the " _
& "Clipboard, to a DataObject, then to "
& "TextBox2!"
End Sub

The macro fails on the DIM statement indicating that it cannot find that
data type. Is this a non-standard data type or does it originate from other
add-ons

TIA for any clues on building/finding it

--
Ken
"Started with Visicalc in 82"

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
User defined data type (losing its data) Ludo Excel Programming 2 May 20th 09 11:34 AM
Wrong data type returned from user-defined function hooroy63 Excel Programming 9 January 13th 09 11:15 AM
Workspace faux user-defined type not defined Chris S[_2_] Excel Programming 3 November 11th 04 05:51 PM
User-defined data type; Error: Only User-defined types... tiger_PRM Excel Programming 1 July 18th 04 03:32 PM
User defined data type augustus108 Excel Programming 1 April 10th 04 05:11 PM


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