Changing VBA to Office Script - Keep One Sheet Tab Visible (Excel Onlin)

Kendra Haug 1 Reputation point

I had this basic code set up on my Excel (Desktop App):

Private Sub Workbook_SheetActivate(ByVal Sh As Object)
Dim xSheet As Worksheet
Application.EnableEvents = False
Set xSheet = Sheets("MainSheet")
If Sh.Name <> xSheet.Name Then
Sh.Move , xSheet
End If
Application.EnableEvents = True
End Sub

I know there is the "3 line" in Excel online that shows all the sheets; but this is quite a big sheet so a lot of scrolling is already involved. I would like to keep on sheet's tab always visible.

Is there an Office Script version of this?

Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
3,452 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. kinuasa 356 Reputation points

    Unfortunately, Office Scripts do not support workbook-level events, so they cannot do the same as VBA.

    1. Differences between Office Scripts and Office Add-ins
    2. Differences between Office Scripts and VBA macros
    0 comments No comments