ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel Paste w/ No User Input (https://www.excelbanter.com/excel-programming/368796-excel-paste-w-no-user-input.html)

Rich[_31_]

Excel Paste w/ No User Input
 
I can across your website detailing Excel automation in Delphi and
found it VERY useful. However, my current project requires a task that
isn't mentioned there or has been covered in the Delphi/Microsoft
newsgroups, yet. If you could spare me a few minutes and take a look
at my problem, I'd be most grateful.

Hello,
I'm copying data that is variable length from the clipboard into a
worksheet. I've figured out to this programatically with one slight
problem. After using ws.Paste, Excel pops up the following MessageBox:

"Data on the clipboard is not the same size and shape of the selected
area. Do you want to paste the data anyway?"

Once I click the OK button the data is pasted, but I'm trying to
hide the Excel interface and need to automate this entire task with no
user input. Is there a way to prevent this message?

I've already tried to send TExcelApplication a RETURN key press
using SendKeys after I paste, but it never gets called because program
execution is waiting for the the ws.Paste function to finish. Any
ideas?

Rich Walls


JON JON

Excel Paste w/ No User Input
 
Have you tried:

Application.DisplayAlerts = False
Your code here

Application.DisplayAlerts = True

"Rich" wrote in message
ups.com...
I can across your website detailing Excel automation in Delphi and
found it VERY useful. However, my current project requires a task that
isn't mentioned there or has been covered in the Delphi/Microsoft
newsgroups, yet. If you could spare me a few minutes and take a look
at my problem, I'd be most grateful.

Hello,
I'm copying data that is variable length from the clipboard into a
worksheet. I've figured out to this programatically with one slight
problem. After using ws.Paste, Excel pops up the following MessageBox:

"Data on the clipboard is not the same size and shape of the selected
area. Do you want to paste the data anyway?"

Once I click the OK button the data is pasted, but I'm trying to
hide the Excel interface and need to automate this entire task with no
user input. Is there a way to prevent this message?

I've already tried to send TExcelApplication a RETURN key press
using SendKeys after I paste, but it never gets called because program
execution is waiting for the the ws.Paste function to finish. Any
ideas?

Rich Walls




Rich[_31_]

Excel Paste w/ No User Input
 
That works...quick response appreciated.

Rich

JON JON wrote:
Have you tried:

Application.DisplayAlerts = False
Your code here

Application.DisplayAlerts = True




All times are GMT +1. The time now is 01:47 PM.

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