inote Posted April 22, 2013 Share Posted April 22, 2013 (edited) #include #include $sFilePath1 = @ScriptDir & "\TEP.HD#1.xlsx" ;This file should already exist $oExcel = _ExcelBookOpen($sFilePath1,@SW_MAXIMIZE) Send("{CTRLDOWN}{PGDN}{CTRLUP}") sleep (1000) $aArray = _ExcelReadSheetToArray($oExcel,1,1,41,4) ;Using Default Parameters _ArrayDisplay($aArray, "Array using Default Parameters") MsgBox(0, "Exiting", "Press OK to Save File and Exit") _ArrayToClip($aArray) ClipGet() _ExcelBookClose($oExcel) ; And finally we close out If @error = 1 Then MsgBox(0, "Error!", "Unable to Create the Excel Object") Exit ElseIf @error = 2 Then MsgBox(0, "Error!", "File does not exist - Shame on you!") Exit EndIfHere is my Array resultHow can I ?- want to trim Row[0] and Col[0] that's added , i want to use only my data (Col1 Row 1)- Copy Array to ClipboardPS. i try to use_ArrayToClip($aArray) ClipGet()and Paste on Notepad but nothing thereThx so much Edited April 22, 2013 by inote Link to comment Share on other sites More sharing options...
water Posted April 22, 2013 Share Posted April 22, 2013 What is Send("{CTRLDOWN}{PGDN}{CTRLUP}")supposed to do? My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
inote Posted April 22, 2013 Author Share Posted April 22, 2013 What is Send("{CTRLDOWN}{PGDN}{CTRLUP}")supposed to do? In Excel i've 2 sheet >>> so i send this for go to 2nd sheet Link to comment Share on other sites More sharing options...
water Posted April 22, 2013 Share Posted April 22, 2013 (edited) - want to trim Row[0] and Col[0] that's added , i want to use only my data (Col1 Row 1) Try$aArray = _ExcelReadSheetToArray($oExcel,1,1,41,4, True) ;Using Default Parameters Edited April 22, 2013 by water My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
water Posted April 22, 2013 Share Posted April 22, 2013 In Excel i've 2 sheet >>> so i send this for go to 2nd sheet Use _ExcelSheetActivate($oExcel, 2)to make it more reliable. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
inote Posted April 22, 2013 Author Share Posted April 22, 2013 Try$aArray = _ExcelReadSheetToArray($oExcel,1,1,41,4, True) ;Using Default Parameters that's the same result Link to comment Share on other sites More sharing options...
inote Posted April 22, 2013 Author Share Posted April 22, 2013 Use _ExcelSheetActivate($oExcel, 2)to make it more reliable. Thx so much Link to comment Share on other sites More sharing options...
water Posted April 22, 2013 Share Posted April 22, 2013 - Copy Array to ClipboardYou have to use function "ClipPut" to write the array to the clipboard. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
water Posted April 22, 2013 Share Posted April 22, 2013 To delete the first row you need to use $aArray = _ExcelReadSheetToArray($oExcel,1,1,41,4) ;Using Default Parameters _ArrayDelete($aArray, 0) My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
inote Posted April 22, 2013 Author Share Posted April 22, 2013 You have to use function "ClipPut" to write the array to the clipboard.so i've to use ClipPut($aArray) , isn't it ? Link to comment Share on other sites More sharing options...
water Posted April 22, 2013 Share Posted April 22, 2013 ClipPut expects a string. In a perfect world you would use _ArrayToString to convert the array to a string. Unfortunataley _ExcelSheetReadToArray returns a two-dimensional array. _ArrayToString only allows one-dimensional arrays. You either have to search the forum for a version of _ArrayToString that supports 2D-arrays or write it yourself. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
inote Posted April 22, 2013 Author Share Posted April 22, 2013 To delete the first row you need to use $aArray = _ExcelReadSheetToArray($oExcel,1,1,41,4) ;Using Default Parameters _ArrayDelete($aArray, 0) Nothing change there's still 1st row ClipPut expects a string. In a perfect world you would use _ArrayToString to convert the array to a string. Unfortunataley _ExcelSheetReadToArray returns a two-dimensional array. _ArrayToString only allows one-dimensional arrays. You either have to search the forum for a version of _ArrayToString that supports 2D-arrays or write it yourself. i'm a newbie that's too hard for me , i don't understand but I've search and find How can i use it for my code Link to comment Share on other sites More sharing options...
water Posted April 22, 2013 Share Posted April 22, 2013 Nothing change there's still 1st rowBut the row saying "41 4" is gone? My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
inote Posted April 22, 2013 Author Share Posted April 22, 2013 But the row saying "41 4" is gone?No , 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