Lotus 123 Copy & Paste w/$PasteFormulas

Neuro_999
Neuro_999 used Ask the Experts™
on
I need to copy from one region to another, but converting the data from "formulas" to "numeric data".
I need doing this with Lotus Scripts.

It must be somethig like that, but dont works.

[a:a1..a:c50].CopyToClipboard($NativeFormat)
[b:a1..b:C50].Paste($PasteFormulas)

But the compiler says to me than the Constant is invalid.
someone knows why?

Thanx a lot.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
This is only an attempt at an answer but here goes. Why not record a macro in Lotus123 in which you do the things you need to do - i.e. copy and paste values and then have a look at the macro to see what was used. As you know to paste values you use edit/pastespecial/and then tick the 'paste values' box.
In a Lotus123 script of a macro for just copying and pasting values it is as follows:

Sub copy_paste
     [<<j:\lotus\Work\123\Untitled.123>>Window~ 1].Activate
     [A:A3].Select
     Selection.CopyToClipboard
     [A:A5].Select
     Selection.Paste ,False,PasteData +~ PasteStyleAndNumberFormats + PasteFormulas + PasteBorders~ + PastesDrawObjectsWithRange,,,,
     [Window 1].Activate
End Sub

I have inserted a ~ (tilde) at the end of the lines which should not have a break in them. Just remove the tilde and ensure the next line after the tilde is included so that you end up with one longer line of macro. make sure you include all the commas - they are not a mistake!

I called the macro copy_paste - you can use whatever name you want.

Hope this is of help.
What a pain I now see that in my visible reply I don't need to add the tildes. so here goes again:-

Sub copy_paste
     [<<j:\lotus\Work\123\Untitled.123>>Window 1].Activate
     [A:A3].Select
     Selection.CopyToClipboard
     [A:A5].Select
     Selection.Paste ,False,PasteData + PasteStyleAndNumberFormats + PasteFormulas + PasteBorders + PastesDrawObjectsWithRange,,,,
     [Window 1].Activate
End Sub

That should read more easily.

Well one of the lines is still split onto two lines but I'm sure you've figured that out already.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial