linbin Posted August 10, 2014 Posted August 10, 2014 #include <Array.au3> #include <Excel.au3> #include <MsgBoxConstants.au3> Local $aiResult = 2 Local $sRange1 = '"' & $aiResult & ':' & $aiResult+1 & '"' Local $oAppl = _Excel_Open() Local $oWorkbook = _Excel_BookOpen($oAppl, @ScriptDir & "\1.xls") ;_Excel_RangeDelete($oWorkbook.ActiveSheet, "2:3") _Excel_RangeDelete($oWorkbook.ActiveSheet, $sRange1) If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Excel UDF: _Excel_RangeDelete Example 1", "Error deleting cells." & @CRLF & "@error = " & @error & ", @extended = " & @extended) Error Msg: @error=2,@extended = -2147352567 _Excel_RangeDelete($oWorkbook.ActiveSheet, "2:3") work, _Excel_RangeDelete($oWorkbook.ActiveSheet, $sRange1) don't. How to modify it?
Solution water Posted August 10, 2014 Solution Posted August 10, 2014 How about: Local $sRange1 = $aiResult & ':' & $aiResult+1 My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.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 (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
Developers Jos Posted August 10, 2014 Developers Posted August 10, 2014 @linbin, Why did you create a new member account in stead of sticking to bin123485? Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
bin123485 Posted August 11, 2014 Posted August 11, 2014 @linbin, Why did you create a new member account in stead of sticking to bin123485? Jos Too many numbers. so stupid id.
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