ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   .PutInClipboard (https://www.excelbanter.com/excel-programming/442645-putinclipboard.html)

USH

.PutInClipboard
 
hELLo EVERYBODY !!
I found this sub on some useful site..
she makes all it's expected from her..
( copy a value to clipboard that will be pasted to an external program
with a mouse macro..)
now everything is working well..
but i don't understand the suggestion in the commented block...
nor if and what i have to do about. tx ! paolo

Sub CopytoClipboard()
' Requires a reference to Microsoft Forms Object Library
' An easy way to do this is to add and then delete a form;
' the reference will persist
With New DataObject
.SetText ActiveCell.Value
.PutInClipboard
End With
End Sub

Dave Peterson[_2_]

.PutInClipboard
 
Open Excel
Open your workbook
Go into the VBE
Show the project explorer
Select your workbook's project
Click on Tools|References and check that "microsoft forms object library"

If that reference were already checked, then you didn't need to do it! But if
it wasn't checked, then you had to do it.

Back to excel and save your workbook.

Just a reference to keep (add it as a comment in your code):

Chip Pearson's site:
http://www.cpearson.com/excel/Clipboard.aspx

It's where I would start if I had questions about using the clipboard in code.



On 05/18/2010 17:02, USH wrote:
hELLo EVERYBODY !!
I found this sub on some useful site..
she makes all it's expected from her..
( copy a value to clipboard that will be pasted to an external program
with a mouse macro..)
now everything is working well..
but i don't understand the suggestion in the commented block...
nor if and what i have to do about. tx ! paolo

Sub CopytoClipboard()
' Requires a reference to Microsoft Forms Object Library
' An easy way to do this is to add and then delete a form;
' the reference will persist
With New DataObject
.SetText ActiveCell.Value
.PutInClipboard
End With
End Sub


USH

.PutInClipboard
 
tx dave..
so i can put to clipboard directly
the value in a cell..

"Dave Peterson" wrote:

Open Excel
Open your workbook
Go into the VBE
Show the project explorer
Select your workbook's project
Click on Tools|References and check that "microsoft forms object library"

If that reference were already checked, then you didn't need to do it! But if
it wasn't checked, then you had to do it.

Back to excel and save your workbook.

Just a reference to keep (add it as a comment in your code):

Chip Pearson's site:
http://www.cpearson.com/excel/Clipboard.aspx

It's where I would start if I had questions about using the clipboard in code.



On 05/18/2010 17:02, USH wrote:
hELLo EVERYBODY !!
I found this sub on some useful site..
she makes all it's expected from her..
( copy a value to clipboard that will be pasted to an external program
with a mouse macro..)
now everything is working well..
but i don't understand the suggestion in the commented block...
nor if and what i have to do about. tx ! paolo

Sub CopytoClipboard()
' Requires a reference to Microsoft Forms Object Library
' An easy way to do this is to add and then delete a form;
' the reference will persist
With New DataObject
.SetText ActiveCell.Value
.PutInClipboard
End With
End Sub

.


Dave Peterson[_2_]

.PutInClipboard
 
It worked ok, right?

On 05/18/2010 19:14, USH wrote:
tx dave..
so i can put to clipboard directly
the value in a cell..

"Dave Peterson" wrote:

Open Excel
Open your workbook
Go into the VBE
Show the project explorer
Select your workbook's project
Click on Tools|References and check that "microsoft forms object library"

If that reference were already checked, then you didn't need to do it! But if
it wasn't checked, then you had to do it.

Back to excel and save your workbook.

Just a reference to keep (add it as a comment in your code):

Chip Pearson's site:
http://www.cpearson.com/excel/Clipboard.aspx

It's where I would start if I had questions about using the clipboard in code.



On 05/18/2010 17:02, USH wrote:
hELLo EVERYBODY !!
I found this sub on some useful site..
she makes all it's expected from her..
( copy a value to clipboard that will be pasted to an external program
with a mouse macro..)
now everything is working well..
but i don't understand the suggestion in the commented block...
nor if and what i have to do about. tx ! paolo

Sub CopytoClipboard()
' Requires a reference to Microsoft Forms Object Library
' An easy way to do this is to add and then delete a form;
' the reference will persist
With New DataObject
.SetText ActiveCell.Value
.PutInClipboard
End With
End Sub

.


USH

.PutInClipboard
 
...quite..
the cpu transformed in a golem of silicium and eated my head..
im writing to you from the afterlife !!



"Dave Peterson" wrote:

It worked ok, right?

On 05/18/2010 19:14, USH wrote:
tx dave..
so i can put to clipboard directly
the value in a cell..

"Dave Peterson" wrote:

Open Excel
Open your workbook
Go into the VBE
Show the project explorer
Select your workbook's project
Click on Tools|References and check that "microsoft forms object library"

If that reference were already checked, then you didn't need to do it! But if
it wasn't checked, then you had to do it.

Back to excel and save your workbook.

Just a reference to keep (add it as a comment in your code):

Chip Pearson's site:
http://www.cpearson.com/excel/Clipboard.aspx

It's where I would start if I had questions about using the clipboard in code.



On 05/18/2010 17:02, USH wrote:
hELLo EVERYBODY !!
I found this sub on some useful site..
she makes all it's expected from her..
( copy a value to clipboard that will be pasted to an external program
with a mouse macro..)
now everything is working well..
but i don't understand the suggestion in the commented block...
nor if and what i have to do about. tx ! paolo

Sub CopytoClipboard()
' Requires a reference to Microsoft Forms Object Library
' An easy way to do this is to add and then delete a form;
' the reference will persist
With New DataObject
.SetText ActiveCell.Value
.PutInClipboard
End With
End Sub
.

.



All times are GMT +1. The time now is 12:32 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com