monicar Posted January 30, 2009 Share Posted January 30, 2009 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 More sharing options...
monicar Posted January 30, 2009 Author Share Posted January 30, 2009 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 More sharing options...
Authenticity Posted January 30, 2009 Share Posted January 30, 2009 (edited) $oExcel.Selection.PasteSpecial(0xFFFFEFBD,Default,Default,Default)or change it to -4163 if it doesn't work.Edit: Check this out - http://hi.baidu.com/study__%D0%A1%B5%B6/bl...345882dde0.htmlxl* constants values. Edited January 30, 2009 by Authenticity Link to comment Share on other sites More sharing options...
monicar Posted January 30, 2009 Author Share Posted January 30, 2009 Thanks Authenticity! $oExcel.Selection.PasteSpecial(0xFFFFEFBD,Default,Default,Default) worked wonderfully. Very interesting. Thanks. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now