Jump to content
Sign in to follow this  
polps

Excel UDF issue with 3.3.12.0 - bug?

Recommended Posts

polps

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

Share this post


Link to post
Share on other sites
water

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 (2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2018-09-01 - Version 1.3.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
JLogan3o13

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

√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites
water

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 (2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2018-09-01 - Version 1.3.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
polps

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

Share this post


Link to post
Share on other sites
water

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 (2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2018-09-01 - Version 1.3.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
polps

Ok, I solved.

Thanks again.

Share this post


Link to post
Share on other sites
water
:)

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2018-09-01 - Version 1.3.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
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
Sign in to follow this  

×