polps Posted June 13, 2014 Share Posted June 13, 2014 (edited) Hello all, I have installed the new release 3.3.12.0. I read in the changelog that Excel UDF was re-written and I read more in the script breacking changes. Wat about the old function _ExcelSheetActivate? I read that this function was renamed in _Excel_SheetActivate but I can't find it in the Help, and my script now detect an error (even changing the name of the function). Can someone clarify me? Thanks Gianluca. Edited June 13, 2014 by polps Link to comment Share on other sites More sharing options...
water Posted June 13, 2014 Share Posted June 13, 2014 Sorry, that is a documentation bug. _Excel_SheetActivate was not renamed but removed. Use $oExcel.Sheets.Item(x).Activate ; x can be the number or name of the sheet to activate 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...
Moderators JLogan3o13 Posted June 13, 2014 Moderators Share Posted June 13, 2014 Does it need to be Sheets.Item(x).Activate? I usually just do Sheets(x).Activate, like so, but am wondering now if it may cause unintended consequences: $oApp = _Excel_Open() $oWorkBook = _Excel_BookOpen($oApp, @DesktopDir & "\Test.xlsx") Sleep(2000) $oWorkBook.Sheets("Sheet410").Activate "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
water Posted June 13, 2014 Share Posted June 13, 2014 (edited) There is no difference because "Item" is the default property of the Sheets collection. Edited June 13, 2014 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...
polps Posted June 13, 2014 Author Share Posted June 13, 2014 (edited) Sorry if I bother you with my questions.. I'm re-writing my script in order to have 3.3.12.0 compatibility. Before this code was ok $oFileTdcShuntingXls = _ExcelBookOpen ( $FileTdcShuntingXls, 1 ) _ExcelSheetActivate ( $oFileTdcShuntingXls, "ShuntingRoutes" ) $xlLastCell = 11 $oFileTdcShuntingXls.ActiveCell.SpecialCells($xlLastCell).Activate I re-wrote in this way, but it seems to me that it si not working... $oExcel = _Excel_Open() $oFileTdcTrafficXls = _Excel_BookOpen ( $oExcel, $FileTdcTrafficXls ) $oFileTdcTrafficXls.Sheets.Item("TrafficRoutes").Activate ; "TrafficRoute" is the name of the sheet to activate $xlLastCell = 11 $oFileTdcTrafficXls.ActiveCell.SpecialCells($xlLastCell).Activate Thanks again. Edited June 13, 2014 by polps Link to comment Share on other sites More sharing options...
Solution water Posted June 13, 2014 Solution Share Posted June 13, 2014 Are you sure that ActiveSheet and ActiveCell are still needed? The rewritten UDF no longer only works with the active sheet. You can now specify the sheet to work with. 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...
polps Posted June 13, 2014 Author Share Posted June 13, 2014 Ok, I solved. Thanks again. Link to comment Share on other sites More sharing options...
water Posted June 13, 2014 Share Posted June 13, 2014 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...
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