We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Initial Selected Sheet Name on Spreadsheet Open

Thread ID:

Created:

Updated:

Platform:

Replies:

142674 Feb 14,2019 10:25 PM UTC Feb 15,2019 08:36 AM UTC WinForms 1
loading
Tags: Spreadsheet
Spotty
Asked On February 14, 2019 10:25 PM UTC

I've loaded and Excel spreadsheet into the spreadsheet file and want to know the name of the worksheet which is initially selected.

Using ManifestSpreadsheet.ActiveSheet.Name works but not upon the initial load when it shows as "Sheet1" although non of the worksheets is called sheet1.

I have determined the Excel file is loaded prior to attempting to read the name.



Arulraj A [Syncfusion]
Replied On February 15, 2019 08:36 AM UTC

Hi Spotty, 

Thanks for using Syncfusion product. 

By initially empty spreadsheet has loaded. So, you may get the ActiveSheet.Name as “Sheet1”.  To get the active sheet name you could use the ActiveSheet.Name property in WorkBookLoaded event which should be triggered in  Form.Load event. Please refer the following code example and the sample. 

VB 
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load 
    AddHandler Me.Spreadsheet1.WorkbookLoaded, AddressOf Spreadsheet1_WorkBookLoaded 
    Spreadsheet1.Open("..\..\Spread1.xlsx") 
End Sub 
 
Private Sub Spreadsheet1_WorkBookLoaded(sender As Object, args As WorkbookLoadedEventArgs) 
    Dim name = Spreadsheet1.ActiveSheet.Name 
End Sub 


Arulraj A 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon