Mongoose Posted December 13, 2012 Posted December 13, 2012 I have a script that opens an Excel file that is stored on a network drive and updates some of the cells using _ExcelWriteCell. Occasionally, the Excel file will open just fine but the target cells don't get updated. What could be causing this behaviour? The relevant lines of code are as follows: $oExcel = _ExcelBookOpen($FileName) _ExcelWriteCell($oExcel,$FileNumber,"E" & $k)
water Posted December 13, 2012 Posted December 13, 2012 You need to add some error checking to your script! What is the value of $FileNumber, what is the value of $k, what is the return value of _ExcelWriteCell, what is the value of @error and @extended after calling _ExcelWriteCell? 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
Mongoose Posted January 11, 2013 Author Posted January 11, 2013 I can do the error checking. My real question is whether anyone else had experienced anything similar and what could have caused this anamolous behaviour.
water Posted January 11, 2013 Posted January 11, 2013 We need the information I asked for in my above post to really help you. 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
redpicker Posted January 11, 2013 Posted January 11, 2013 I can do the error checking.My real question is whether anyone else had experienced anything similar and what could have caused this anamolous behaviour.Although I am not a very advanced user, I do use the Excel functions quite a bit, and Yes, I have experienced this behavior before. Usually, it is because there was a problem with the _ExcelBookOpen command syntax or that of the _ExcelWriteCell. The Error checking suggestions will probably lead you to the solution. If not, posting the results here will. In my experience, it is usually badly hacked code that isn't doing what I expect it to be doing; sometimes, despite my errors, it works out and writes to the intended cell despite my mistakes, othertimes it doesn't.
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