ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   PasteSpecial (https://www.excelbanter.com/excel-programming/348096-pastespecial.html)

John Austin[_6_]

PasteSpecial
 
I have a VB6 app that uses Excel to create spreadsheets. It needs to use
PasteSpecial with xlPasteValues extensively.
Whilst the program is getting Excel to Copy / PasteSpecial, the users often
inadvertantly use copy / paste in another application. This either causes
junk in the Excel spreadsheet or junk in their other app.

I would like to get around this problem, so is the
a) a means of copying without use of the clipboard that will place values,
not formulas in the destination cells (eg Range.CopySpecial (Dest,
xlCopyValues) ), or
b) a means of locking the clipboard for the duration of the few hundred Copy
/ PasteSpecial operations, or
c) a means of stopping the user using the clipboard in other apps whilst the
Excel routine is running, or
d) any other idea that will overcome the problem?

Many thanks,
--
John Austin

Charlie

PasteSpecial
 
Why do you need to use copy/paste? In your VB app you can get and put
two-dimensional data like this:

Dim RangeGrid() As Variant
RangeGrid = Range("A1:Z26")
(code here to modify data as necessary in 2D-array)
Range("Sheet2!A1:Z26").Value = RangeGrid


"John Austin" wrote:

I have a VB6 app that uses Excel to create spreadsheets. It needs to use
PasteSpecial with xlPasteValues extensively.
Whilst the program is getting Excel to Copy / PasteSpecial, the users often
inadvertantly use copy / paste in another application. This either causes
junk in the Excel spreadsheet or junk in their other app.

I would like to get around this problem, so is the
a) a means of copying without use of the clipboard that will place values,
not formulas in the destination cells (eg Range.CopySpecial (Dest,
xlCopyValues) ), or
b) a means of locking the clipboard for the duration of the few hundred Copy
/ PasteSpecial operations, or
c) a means of stopping the user using the clipboard in other apps whilst the
Excel routine is running, or
d) any other idea that will overcome the problem?

Many thanks,
--
John Austin



All times are GMT +1. The time now is 08:59 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com