redrum

Excel "Range copy and paste"

9 posts in this topic

Hello,

I have been trying to use the Excel copy/paste type VB statements within AuotIt to move data between blocks of cells, using the following type statements:

$oExcelDP.Range(Cells(9, 3).Address, Cells(12, 7).Address).copy destination:=$oExcelDP.Range(Cells($BDrow+1, 2).Address, Cells($BDrow+4, 6).Address)

Then I  remembered the "names" are not used in AutoIt so tried - 

$oExcelDP.Range(Cells(9, 3).Address, Cells(12, 7).Address).copy $oExcelDP.Range(Cells($BDrow+1, 2).Address, Cells($BDrow+4, 6).Address)

Also tried the above statement without the ".Address".  Tried including the Workbooks("sheet"). prior to the range definition also.

 

I changed to reading the block to an array and then writing back to the new block location - which is working fine.

However, I'd like to know if there is a way to use the Excel VB commands for copy/paste data block ranges in AutoIt.  I suspect I may just have some error in my statements above.

Thanks,

Doug

 

Share this post


Link to post
Share on other sites



Is there a reason you're not using the built in Excel functions, like _Excel_RangeCopyPaste or _Excel_RangeInsert?


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

I did not find these Excel functions in the help.  So, I guess I need to update my Excel UDF as there must be some functions that I don't have.  Will check further on the Forum on this.

Thanks

Share this post


Link to post
Share on other sites

Which version of AutoIt do you run?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

I'm running v3.3.9.4 Beta most of the time.  Sometimes v3.3.8.1 - using this for some older scripts, but could probably use the Beta version for these also, just have not tried that.

Share this post


Link to post
Share on other sites

AutoIt is moving forward all the time. It blows having to update for script-breaking changes, but you'll find you miss out on new features by not keeping up. I would suggest getting yourself up to 3.3.12.0 as soon as you're able.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

OK that sounds good - now is a good time to do that as I am making significant changes to scripts. Regarding this upgrade I have a couple questions:

1.  I went to the Beta version quite awhile back because it had the com functions in it, and I was having some issues that required the com functions.  So, in the new version,are those com functions now included that used to only be in Beta?

2.  Are the new/updated Excel functions in this newer version also, or is there some specific Excel support that I also need to download and include?

Thanks

Share this post


Link to post
Share on other sites

For the most part, Yes and yes. For a complete list of what has been added or not, I would suggest installing the latest stable version and then reading through the Change Log.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

OK, thanks for your quick responses.

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