Jump to content

Excel "Range copy and paste"


redrum
 Share

Recommended Posts

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

 

Link to comment
Share on other sites

  • Moderators

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

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

Which version of AutoIt do you run?

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

  • Moderators

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.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

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

Link to comment
Share on other sites

  • Moderators

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.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

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...