View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Patrick Molloy[_2_] Patrick Molloy[_2_] is offline
external usenet poster
 
Posts: 1,298
Default Pasting values from a closed Excel instance

in the second instance, add a workbook then

dim wb as workbook
set wb = workbooks.add
ws.Activesteet.Paste
ws.Activesteet.Copy

ThisWorkbook.Worksheets("Sheet1").Pastespecial xlAll

wb.close false


"Jan Kronsell" wrote:

I copy a cell containing a date from a sheet of one instance of Excel. Then
closes Excel down. In another instance of Excel I like to PasteSpecial the
value of the cell. The pasting part is what I like to do using VBA. But if I
record a macro it comes up with

ActiveSheet.PasteSpecial Format:="Text"...

So its the text value of the date thats pasted, not the numeric value.

If I try using

Selection.PasteSpecial Paste:=xlPasteValues

I get a runtime error 1004: The method PasteSpecial of class Range failed.

(My own translation from a danish version of Excel, so it may bw incorrect,
but I hope you get the idea.

How should I accomplish what I need?

Jan