itipu
08-18-2008, 02:36 PM
Hi all,
I have a Long which is just a big number I get through summing up values of a few ranges... so it is in memory. I would like to paste the value of this Long in a Word document which I already have opened and populated, so I have something like that:
Excel:
Dim pTotal As Long
pTotal = wsOne.Range("W33").Value + wsOne.Range("W35").Value
Word:
wrdApp.Selection.TypeText Text:="number"
wrdApp.Selection.TypeParagraph
All of these do work, I am just not sure how to send Long to clipboard, DataObject seems to work with String... I can than paste something like wrdApp.Selection.Paste...
Of course a quick hack would be to set some odd cell value to my pTotal and than do a Copy and Paste but surely there is a cleaner way?
Thanks a lot
Mike
I have a Long which is just a big number I get through summing up values of a few ranges... so it is in memory. I would like to paste the value of this Long in a Word document which I already have opened and populated, so I have something like that:
Excel:
Dim pTotal As Long
pTotal = wsOne.Range("W33").Value + wsOne.Range("W35").Value
Word:
wrdApp.Selection.TypeText Text:="number"
wrdApp.Selection.TypeParagraph
All of these do work, I am just not sure how to send Long to clipboard, DataObject seems to work with String... I can than paste something like wrdApp.Selection.Paste...
Of course a quick hack would be to set some odd cell value to my pTotal and than do a Copy and Paste but surely there is a cleaner way?
Thanks a lot
Mike