AI123 Posted May 1, 2021 Posted May 1, 2021 (edited) [UPDATE: PROBLEM SOLVED, WORKS NOW WITHOUT CHANGES] Hello, I have this code: ;Local $var = "C:\Users\q\Downloads\tshirts\Daten.xlsx" ; lokal auf Rechner Local $var = "\\fritz.box\FRITZ.NAS\ESD_USB\tshirts\Daten.xlsx" ; über USB-Stick an FritzBOX Local $oWorkbook = _Excel_BookOpen($oExcel_1,$var) With the commented local path all worked well. But with my network path I get this error: "C:\Program Files (x86)\AutoIt3\Include\Excel.au3" (233) : ==> The requested action with this object has failed.: Local $oWindow = $oExcel.Windows($oWorkbook.Name) Local $oWindow = $oExcel.Windows($oWorkbook^ ERROR ->11:59:07 AutoIt3.exe ended.rc:1 +>11:59:07 AutoIt3Wrapper Finished. >Exit code: 1 Time: 1.772 My OS is Windows 10. If I enter \\fritz.box\FRITZ.NAS\ESD_USB\tshirts\Daten.xlsx in the Windows explorer Excel is opened with this file, so the file path is right. So why can't I open the file in the network with _Excel_BookOpen? And what have I to do to do it? Edited May 1, 2021 by AI123
water Posted May 1, 2021 Posted May 1, 2021 Which version of AutoIt do you run? 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
AI123 Posted May 1, 2021 Author Posted May 1, 2021 (edited) After a lot of restarts now it works without changes. I don't know why, but problem seems to be solved. Edited May 1, 2021 by AI123
water Posted May 1, 2021 Posted May 1, 2021 👍 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
seadoggie01 Posted May 1, 2021 Posted May 1, 2021 I've seen this before with AutoIt scripts... but not with _Excel_BookOpen. I recently found that you can map a network drive easily and temporarily while your script is running, which seems to solve my issues with network files. Func DoStuffWithNetworkDrive($sNetworkPath) ; Map the drive to any drive letter this function then returns the letter Local $sDrive = DriveMapAdd($sNetworkPath, "*") If @error Then Exit MsgBox(0, "Network Drive", "Failed to map the network drive, check that it's connected") ; Do your stuff here DriveMapDelete($sDrive) EndFunc The other thing to note (and may not be valid for non-http or https paths) is that you should make sure that the network location (the root folder) is in your "Trusted Sites" in internet explorer. (Open IE, click Settings, Internet Options, switch to the Security tab, select Trusted Sites, click Sites button, then finally add the address) All my code provided is Public Domain... but it may not work. Use it, change it, break it, whatever you want. Spoiler My Humble Contributions:Personal Function Documentation - A personal HelpFile for your functionsAcro.au3 UDF - Automating Acrobat ProToDo Finder - Find #ToDo: lines in your scriptsUI-SimpleWrappers UDF - Use UI Automation more Simply-erKeePass UDF - Automate KeePass, a password managerInputBoxes - Simple Input boxes for various variable types
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