LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
Bon Bon is offline
external usenet poster
 
Posts: 23
Default How to disable MS Excel Clipboard message when I run a macro

Hello all

I want to disable the Microsoft Excel clipboard message. How can I do
it?

I create a macro in MS Word 2000. The macro is used to copy a
worksheet content (include graphic, chart and text) to Word. The macro
is working fine. But, the MS Excel message always popped up everytime I
run the macro.

The MS Excel message is as below:

"There is a large amount of information on the Clipboard. Do you want
to be able to paste this information into another program later?
- To save it on the Clipboard so that you can paste it later, click
Yes.
- To delete it from the Clipboard and free memory, click No."

My Word macro is as follow:

Sub CopyExcelToWord()

Dim xlApp As Excel.Application
Dim xlWorkbook As Excel.Workbook
Dim xlWorksheet As Excel.Worksheet
Dim xlRange As Excel.Range
Dim ExcelWasNotRunning As Boolean
Dim WorkbookToWorkOn As String

WorkbookToWorkOn = "c:\test\Book2.xls"

On Error Resume Next
Set xlApp = GetObject(, "Excel.Application")

If Err Then
ExcelWasNotRunning = True
Set xlApplication = New Excel.Application
End If
xlApp.Visible = False

Set xlWorkbook = xlApp.Workbooks.Open(FileName:=WorkbookToWorkOn)
Set xlWorksheet = xlWorkbook.Worksheets("Sheet1")
xlWorksheet.Range("A1:R59").Copy

ActiveDocument.Bookmarks("PersonalData").Range.Pas teSpecial _
link:=False, _
DataType:=wdPasteMetafilePicture

If ExcelWasNotRunning Then
xlApp.Quit
End If

xlWorkbook.Close
Set xlRange = Nothing
Set xlWorksheet = Nothing
Set xlWorkbook = Nothing
Set xlApp = Nothing
End Sub

Please give me some suggestions

Thanks
Bon

 
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
How to disable displaying clipboard within Excel? Eric Excel Discussion (Misc queries) 2 August 25th 09 11:53 AM
How do I disable 'clipboard' message window in an Excel macro? Jason Griesbach Excel Programming 2 October 19th 04 10:54 PM
enable disable macro message Lisa Fischer Excel Programming 4 May 21st 04 10:27 PM
Remove Enable/Disable Macro message at startup carvil16[_3_] Excel Programming 1 January 27th 04 04:25 PM
Disable Clipboard Dialog Box during Macro Tom Excel Programming 0 August 15th 03 04:52 PM


All times are GMT +1. The time now is 01:45 AM.

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

About Us

"It's about Microsoft Excel"