Jump to content

Excel UDF issue with 3.3.12.0 - bug?


Go to solution Solved by water,

Recommended Posts

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 by polps
Link to comment
Share on other sites

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 - 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 (NEW 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

 

Link to comment
Share on other sites

  • Moderators

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

There is no difference because "Item" is the default property of the Sheets collection.

Edited 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 - 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 (NEW 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

 

Link to comment
Share on other sites

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 by polps
Link to comment
Share on other sites

  • Solution

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 - 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 (NEW 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

 

Link to comment
Share on other sites

:)

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.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 (NEW 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

 

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...