PasteSpecial
Sometimes it works and sometimes it doesn't
ActiveWorkbook.FollowHyperlink Address: ................. ActiveSheet.PasteSpecial Format:="Text",Link:=False DisplayAsIcon:= False GET: Rin-time error 1004 PasteSpecial method of Worksheet class failed Thanks, GJ |
PasteSpecial
Is there something in the clipboard that can be pasted per the instruction
-- Regards, Tom Ogilvy "gj" wrote: Sometimes it works and sometimes it doesn't ActiveWorkbook.FollowHyperlink Address: ................. ActiveSheet.PasteSpecial Format:="Text",Link:=False DisplayAsIcon:= False GET: Rin-time error 1004 PasteSpecial method of Worksheet class failed Thanks, GJ |
PasteSpecial
Tom Ogilvy wrote:
Is there something in the clipboard that can be pasted per the instruction -- Regards, Tom Ogilvy "gj" wrote: Sometimes it works and sometimes it doesn't ActiveWorkbook.FollowHyperlink Address: ................. ActiveSheet.PasteSpecial Format:="Text",Link:=False DisplayAsIcon:= False GET: Rin-time error 1004 PasteSpecial method of Worksheet class failed Thanks, GJ Thanks Tom. Here is what is to be copied from the clipboard. It is in the clipboard MONTHLY SPONSORING REPORT FOR NVP# 15139004 - Lynn Puana FOR THE PERIOD OF 07-01-06 TO 07-21-06 AMOUNTS DISPLAYED IN US DOLLARS NVP....... RVP....... AM........ DM........ SPONSOR FULL NAME... #CONS NEW CONSULTANT DATA........... BDAY.... ST.DATE. MTD RV...... 15139004 15139004 15139004 15139004 15139004 1 16250279 06-12-76 07-03-06 1468.00 Puana Puana Puana Puana Lynn Puana Anne Ristau 4 Fruit Hopkinton, MA 01748 508-625-1418 (H) 617-610-3081 (B) 15139004 15139004 15139004 15139004 15139004 1 16264134 03-25-45 07-07-06 261.00 Puana Puana Puana Puana Lynn Puana Janet Welch 23950 FM 485 Burlington, TX 76519 254-869-0018 (H) 15139004 15139004 15139004 15139004 15139004 1 16272970 04-01-72 07-11-06 251.00 Puana Puana Puana Puana Lynn Puana Ann Collette Youngblood 3824 Nansemond Cir Norfolk, VA 23513 Program: 1) Copies activesheet.pastespecial format:= "text" (Eliminates there logo) 2) Deletes rows 1 to 15 (above example rows 1 -9) 3) Run next Sub Mailing_List() 4) Checks for 2nd name is Puana If Puana, Prints Name & address Else skip to next row and try again till end of file All works except PasteSpecial. PasteSpecial does work now and then. Thinking of putting in an If condition (if Special errors, loop and try again) Many many thanks, Tom Gordon |
PasteSpecial
generally code that works intermittenly isn't problematic because of the code
per se. It is usually because the code depends on a certain environment - and the environment changes. You could be trying to past into merged cells or the clipboard could have gotten clear or pasting isn't an option at that point. You could probably check the state of the past special command button in Edit=Pastespecial (with your code). If it is disabled, then you won't be able to paste. You could halt and try to figure out why. -- Regards, Tom Ogilvy "gj" wrote: Tom Ogilvy wrote: Is there something in the clipboard that can be pasted per the instruction -- Regards, Tom Ogilvy "gj" wrote: Sometimes it works and sometimes it doesn't ActiveWorkbook.FollowHyperlink Address: ................. ActiveSheet.PasteSpecial Format:="Text",Link:=False DisplayAsIcon:= False GET: Rin-time error 1004 PasteSpecial method of Worksheet class failed Thanks, GJ Thanks Tom. Here is what is to be copied from the clipboard. It is in the clipboard MONTHLY SPONSORING REPORT FOR NVP# 15139004 - Lynn Puana FOR THE PERIOD OF 07-01-06 TO 07-21-06 AMOUNTS DISPLAYED IN US DOLLARS NVP....... RVP....... AM........ DM........ SPONSOR FULL NAME... #CONS NEW CONSULTANT DATA........... BDAY.... ST.DATE. MTD RV...... 15139004 15139004 15139004 15139004 15139004 1 16250279 06-12-76 07-03-06 1468.00 Puana Puana Puana Puana Lynn Puana Anne Ristau 4 Fruit Hopkinton, MA 01748 508-625-1418 (H) 617-610-3081 (B) 15139004 15139004 15139004 15139004 15139004 1 16264134 03-25-45 07-07-06 261.00 Puana Puana Puana Puana Lynn Puana Janet Welch 23950 FM 485 Burlington, TX 76519 254-869-0018 (H) 15139004 15139004 15139004 15139004 15139004 1 16272970 04-01-72 07-11-06 251.00 Puana Puana Puana Puana Lynn Puana Ann Collette Youngblood 3824 Nansemond Cir Norfolk, VA 23513 Program: 1) Copies activesheet.pastespecial format:= "text" (Eliminates there logo) 2) Deletes rows 1 to 15 (above example rows 1 -9) 3) Run next Sub Mailing_List() 4) Checks for 2nd name is Puana If Puana, Prints Name & address Else skip to next row and try again till end of file All works except PasteSpecial. PasteSpecial does work now and then. Thinking of putting in an If condition (if Special errors, loop and try again) Many many thanks, Tom Gordon |
All times are GMT +1. The time now is 05:50 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com