Jump to content
Sign in to follow this  
monicar

How to convert Excel PasteSpecial with options (VB) to AutoIt

Recommended Posts

monicar

I am using AutoIt to "Copy" and "PasteSpecial" in an Excel spreadsheet. I created a Excel macro and I have the code from it. The copy and other fuctions that do not have options work ok, but I do not know how to "convert" the options part of the statement to Auto-It.

In the Excel macro:

Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _

:=False, Transpose:=False

In AutoIt, I tried the following:

$oExcel.Selection.PasteSpecial(xlPasteValues,xlNone)

But when I tried to run it, I get a Syntax Errror:

D:\AutoIt Scripts\DailyARsReportVer2.au3(102,45) : ERROR: syntax error

$oExcel.Selection.PasteSpecial(xlPasteValues,

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

Thanks for your help,

Monica

Share this post


Link to post
Share on other sites
monicar

I also tried:

$oExcel.Selection.PasteSpecial(xlPasteValues,Default,Default,Default)

gave me a syntax error

And:

$oExcel.Selection.PasteSpecial("xlPasteValues",Default,Default,Default)

executed but did not perform a paste in the Excel sheet.

Thanks.

Share this post


Link to post
Share on other sites
monicar

Thanks Authenticity!

$oExcel.Selection.PasteSpecial(0xFFFFEFBD,Default,Default,Default) worked wonderfully. Very interesting. Thanks.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×