Mongoose Posted December 13, 2012 Share 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) Link to comment Share on other sites More sharing options...
water Posted December 13, 2012 Share 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 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...
Mongoose Posted January 11, 2013 Author Share 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. Link to comment Share on other sites More sharing options...
water Posted January 11, 2013 Share 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 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...
redpicker Posted January 11, 2013 Share 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. 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