LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 194
Default Why is my clipboard empty?

I wrote a macro to filter my worksheet and hide certain columns, then sort
and select the results and copy to the clipboard so I can paste into Word.
It worked fine - until I stuck in some more code to un-filter, un-sort, and
un-hide everything to reset the workbook. Then, when the code opens my Word
doc, the clipboard is empty. What am I doing wrong?

Ed

Here's the relevant sections. This works if I comment out between the ***.

' Put range on clipboard
ActiveCell.SpecialCells(xlLastCell).Select
Range(Selection, Cells(1)).Select
Selection.Copy

***

' Reset worksheet
' Unhide everything
Sheets("Sheet1").Activate

Sheets("Sheet1").AutoFilterMode = False

With Cells
.EntireColumn.Hidden = False
.EntireRow.Hidden = False
End With

' Resort to TIR No.
' Module 12
SortTIRNo

***

' Open template, which has Auto_Open macro
' to paste clipboard and make EFF tables
doc = "C:\Documents and
Settings\username\Desktop\Reports\TablesTemplate.d oc"
Set WD = CreateObject("Word.Application")
WD.Documents.Open doc
WD.Visible = True

End Sub


 
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
Cannot empty the clipboard Jaleel Excel Discussion (Misc queries) 1 November 22nd 09 08:57 PM
Clipboard empty but still get waring that clipboard is full Steve Excel Discussion (Misc queries) 0 June 17th 08 09:05 PM
Clipboard empty but get cannot empty CB when trying to copy Peter @ ServiceMaster Excel Worksheet Functions 0 February 22nd 07 03:58 PM
cannot empty the clipboard Fred Excel Discussion (Misc queries) 0 October 10th 06 08:53 PM
Cannot empty the Clipboard OhWellJon Excel Discussion (Misc queries) 0 September 19th 06 07:19 PM


All times are GMT +1. The time now is 04:35 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"