Posted 16 July 2019, 5:43 am EST
Hi,
In my application I have a method that adds a new sheet. I am upgrading my application from Spread 9 to Spread 12 (using build 12.45.20181). My existing code from the Spread 9 project is not behaving the same way in Spread 12. Based on Spread 12 help created the following code to try to diagnose what is happening.
Public Sub AddSchedule()
Dim shv As New FarPoint.Win.Spread.SheetView()
With frmMain.spdProj .Sheets.Add(shv) .ActiveSheet.ActiveColumnIndex = 0 .ActiveSheet.ActiveRowIndex = 0 .TabStripPolicy = FarPoint.Win.Spread.TabStripPolicy.Never .Sheets.Count = .Sheets.Count + 1 .ActiveSheetIndex = .Sheets.Count - 1 .Sheets(0).Visible = False .Sheets(.Sheets.Count - 1).Visible = True Dim intSheet As Integer = .ActiveSheetIndex End With End Sub
When I call the above Method I have 2 problems;
- The sheet added is completely blank.
- The ActiveSheetIndex property has a value of -1
If I save the .xml file and reopen it the new sheet is there. I just seems I can’t access it without saving and reopening.
Thanks, Ed