Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default Pasting values from a closed Excel instance

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


  #2   Report Post  
Posted to microsoft.public.excel.programming
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default Pasting values from a closed Excel instance

Thanks.

Jan
"Patrick Molloy" skrev i en
meddelelse ...
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





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Pasting values from a closed Excel instance

Thank you.

Jan
"Patrick Molloy" wrote in message
...
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





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel Pasting Values and not Formula David Adamson Excel Discussion (Misc queries) 0 January 15th 09 11:15 PM
Excel is pasting values, not formulas by default Kirstin Excel Discussion (Misc queries) 3 July 4th 08 02:23 AM
Return Single Instance of Numeric Values from a Column Sam via OfficeKB.com Excel Worksheet Functions 4 August 26th 05 03:10 AM
How can I add values to a closed excel file? Ali Excel Worksheet Functions 8 June 11th 05 01:13 AM
Excel clipboard should allow pasting of formulae not just values Desperate Don Excel Discussion (Misc queries) 0 April 28th 05 05:54 PM


All times are GMT +1. The time now is 09:31 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"