Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to empty the clipboard using vba code

Hello fellow developers,

I'm writing vba code for years now, in Excel as well in
other Office applications.
Now I stumble into a little problem I like to resolve.
I copy some rows in a previous function, open a new .xls
file, paste the rows in the new sheet, ans save the new
sheet.
However, when I close Excel, I get the question if I want
to keep the -into the clipboard copied data- for further
use.
And I don't want this question.. because the new file is
just a file I use lateron as a Word datafile.

Does anybody know a solution to use vba code to empty the
clipboard, or any other solution so I don't get the
popwindow anymore??

The code I have written so far is:

Function fncCreateNewSheet(strNewFilename As String) As
Boolean
On Error GoTo err_fncCreateNewSheet

Application.StatusBar = "Put copied rows into new sheet..."
Set xlApp2 = CreateObject("Excel.Application")
Set xlBook2 = xlApp2.Workbooks.Add
Set xlSheet2 = xlBook2.Worksheets(1)

xlApp2.Visible = True
xlSheet2.Cells(1, 1).Select

xlSheet2.Paste
Application.StatusBar = "Save Datafile as " &
strNewFilename
xlBook2.SaveAs strNewFilename, , , , True

'//Here I like to empty the clipboard??
''clipboard.Empty

xlBook2.Close
xlApp2.Quit
Set xlApp2 = Nothing

exit_fncCreateNewSheet:
Exit Sub

err_fncCreateNewSheet:
Call subErrorHandling(True, Err, Erl, Err.Description,
CurrentType, CurrentName, "fncCreateNewSheet")
Resume exit_fncCreateNewSheet

End Function
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default How to empty the clipboard using vba code

Robin,

Use

Application.CutCopyMode = False

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Robin Ketting" wrote in message
...
Hello fellow developers,

I'm writing vba code for years now, in Excel as well in
other Office applications.
Now I stumble into a little problem I like to resolve.
I copy some rows in a previous function, open a new .xls
file, paste the rows in the new sheet, ans save the new
sheet.
However, when I close Excel, I get the question if I want
to keep the -into the clipboard copied data- for further
use.
And I don't want this question.. because the new file is
just a file I use lateron as a Word datafile.

Does anybody know a solution to use vba code to empty the
clipboard, or any other solution so I don't get the
popwindow anymore??

The code I have written so far is:

Function fncCreateNewSheet(strNewFilename As String) As
Boolean
On Error GoTo err_fncCreateNewSheet

Application.StatusBar = "Put copied rows into new sheet..."
Set xlApp2 = CreateObject("Excel.Application")
Set xlBook2 = xlApp2.Workbooks.Add
Set xlSheet2 = xlBook2.Worksheets(1)

xlApp2.Visible = True
xlSheet2.Cells(1, 1).Select

xlSheet2.Paste
Application.StatusBar = "Save Datafile as " &
strNewFilename
xlBook2.SaveAs strNewFilename, , , , True

'//Here I like to empty the clipboard??
''clipboard.Empty

xlBook2.Close
xlApp2.Quit
Set xlApp2 = Nothing

exit_fncCreateNewSheet:
Exit Sub

err_fncCreateNewSheet:
Call subErrorHandling(True, Err, Erl, Err.Description,
CurrentType, CurrentName, "fncCreateNewSheet")
Resume exit_fncCreateNewSheet

End Function



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
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 cjones Excel Discussion (Misc queries) 0 August 9th 06 11:10 PM
"Cannot empty Clipboard" tiff Excel Worksheet Functions 0 October 10th 05 10:18 PM
How do I empty the clipboard, when nothing is in it? Jill Excel Worksheet Functions 2 May 5th 05 11:25 AM


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