titi9030 Posted May 30, 2016 Share Posted May 30, 2016 HI to everybody I am trying to open an excel file, but I can not figure out what is the correct syntaxis of it.. I have read it from the help part of autoi, but unfortunatelly I coud not find what's the correct way for doing it, I`d like to open a file that exist in my desktop "#include <Excel.au3> _Excel_BookOpen ( $oExcel, $sFilePath [, $bReadOnly = False [, $bVisible = True [, $sPassword = Default [, $sWritePassword = Default [, $bUpdateLinks = Default]]]]] )" Thank you very much Link to comment Share on other sites More sharing options...
titi9030 Posted May 30, 2016 Author Share Posted May 30, 2016 Just now, titi9030 said: HI to everybody I am trying to open an excel file, but I can not figure out what is the correct syntaxis of it.. I have read it from the help part of autoit, but unfortunatelly I coud not find what's the correct way for doing it, I`d like to open a file that exist in my desktop "#include <Excel.au3> _Excel_BookOpen ( $oExcel, $sFilePath [, $bReadOnly = False [, $bVisible = True [, $sPassword = Default [, $sWritePassword = Default [, $bUpdateLinks = Default]]]]] )" Thank you very much Link to comment Share on other sites More sharing options...
water Posted May 30, 2016 Share Posted May 30, 2016 Welcome to AutoIt and the forum! Did you have a look at the example scripts that come with the help file? $sPath should be something like @DesktopDir & "\Your_Filename.xlsx" 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...
titi9030 Posted May 30, 2016 Author Share Posted May 30, 2016 10 hours ago, water said: Welcome to AutoIt and the forum! Did you have a look at the example scripts that come with the help file? $sPath should be something like @DesktopDir & "\Your_Filename.xlsx" I have tried with it, but it doesn't work either Thanks for your support, i really apreciate.. Link to comment Share on other sites More sharing options...
water Posted May 30, 2016 Share Posted May 30, 2016 Can you please post the exact code you used? 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...
titi9030 Posted May 30, 2016 Author Share Posted May 30, 2016 #include <Excel.au3> @DesktopDir & "\hola.xlsx" hola is the name of the file in my desktop Link to comment Share on other sites More sharing options...
water Posted May 30, 2016 Share Posted May 30, 2016 OK, let's try this little script: #include <Excel.au3> Global $oExcel = _Excel_Open() MsgBox(0, "", "Open: " & @error) Global $sFilePath = @DesktopDir & "\hola.xlsx" _Excel_BookOpen($oExcel, $sFilePath) MsgBox(0, "", "BookOpen: " & @error) What do you get? 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...
titi9030 Posted May 30, 2016 Author Share Posted May 30, 2016 it was exactly what I was expected, thank you very for your help and support...!!!!! Link to comment Share on other sites More sharing options...
water Posted May 30, 2016 Share Posted May 30, 2016 Great. What's the next step? How do you want to process the Excel workbook? 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...
titi9030 Posted May 30, 2016 Author Share Posted May 30, 2016 i want to open a website and look for some information I have read in workbook, the idea is to create cycle in order to copy from Excel and paste into the website.. the information would be in range "a1" into the workbook and once I have look it into the website I wanto copy the information I need in range "a2" then "a3", "a4" depens on what I am looking for... I am using autoit, coz it allow me to use the mouse to click into the website, it was not possible in visual basic for Excel.. What can you recommend me? #include <IE.au3> $sURL = "http://www.despegar.com.co/" $oIE = _IECreate($sURL, 0, 0, 0) $HWND = _IEPropertyGet($oIE, "hwnd") WinSetState($HWND, "", @SW_MAXIMIZE) _IEAction($oIE, "visible") _IELoadWait($oIE) MouseClick($MOUSE_CLICK_PRIMARY, 85, 342, 2) Link to comment Share on other sites More sharing options...
water Posted May 30, 2016 Share Posted May 30, 2016 To read data from Excel use function _Excel_RangeRead. Either cell by cell or the whole worksheet and then loop through the array. I wouldn't use functions to automate the browser via GUI (WinSetState, MouseClick ...) because they are not very reliable. They depend on screen resolution and window position. I suggest to use the IE* functions for everything. 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...
titi9030 Posted May 30, 2016 Author Share Posted May 30, 2016 Thanks a lot dude, I would try it and let you know.... thanks for your comments... 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