View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Jos Vens[_2_] Jos Vens[_2_] is offline
external usenet poster
 
Posts: 134
Default Put text on clipboard?

Hi Harald,

I know that, but what if a library is not on the local machine of the user?
I can provide it in my setup but if I work on drive D (let's say, I put the
..dll which is the referenced library in folder D:\Program\MyRef.dll) and the
user installs on C:\ (lets say in folder C:\Program\MyRef.dll), will it stil
work or will he get an error message on startup? I mean, is the path (which
you can link on the blank userform absolute or relative?)

Jos

"Harald Staff" schreef in bericht
...
Hi Jos

There are libraries and there are libraries. Just insert a blank userform
in
the workbook and the reference is there without further actions.

HTH. Best wishes Harald

"Jos Vens" skrev i melding
...
Hi Paul,

Thanks for your reply. I guess that is exactly what I want, but it has to
work without extra references. Maybe It can work with an API-call -
that
would be OK! But, in VBA, I guess it is not possible without making
references to new libraries, and I don't want to do that.

Thanks again,
Jos Vens

"PaulD" <nospam schreef in bericht
...
"Jos Vens" wrote in message
...
: Hi,
:
: I wonder if you can put some predefined text on the clipboard (not
the
: contents of a cell - dashed line) but a text like you should copy in

any
: program (and like you can copy a part of text in the formulabar of a
whole
: line).
:
: I'd like to paste it back when I'm inputting in a cell when the user
needs
: it (ctrl-v works then).
:
: thanks
: Jos Vens
:
Not sure I fully understand, are you looking for something like this?

Sub Macro1()
Dim MyData As DataObject
Set MyData = New DataObject
MyData.SetText "Enter what you want on the clipboard here"
MyData.PutInClipboard
End Sub

In order to run since MyData is earlybind, you must go to tools

reference
in
the VBA editor and select Microsoft Forms 2.0 Object Library. Or you

can
change to late bind (i.e. use CreateObject)
Paul D