Jump to content

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


monicar
 Share

Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...