Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
Anonymous
425 Views, 3 Replies

GoExcel issues after Excel upgrade ("MyFile.xlsx is already open.")

"OriginalGetComponentPath" is my old code, which worked fine until my Excel was upgraded (from 2010 to 2016).

I created "TestGetComponentPath" recently for troubleshooting.

Both functions bring up a prompt saying "MyFile.xlsx is already open. Reopening will cause any changes you made to be discarded. Do you want to reopen MyFile.xlsx?" at the GoExcel.Cellvalue row.

 

Is there an issue with the code, or is it the new Excel installation?

Help is greatly appreciated! 

 

Class Runme
	Sub Main
		Dim ComponentName As String = ""
		ComponentName = OriginalGetComponentPath("MyComponent")
		ComponentName = TestGetComponentPath("MyComponent")
	End Sub


	Public Function OriginalGetComponentPath(Denomination As String) As String
		Dim RefRow = GoExcel.FindRow("3rd Party:ConfiguratorParameters", "FileReferences", "Description", "=", Denomination)
		Dim ComponentPath = GoExcel.CellValue("3rd Party:ConfiguratorParameters", "FileReferences", "D" & RefRow)
		Return ComponentPath
	End Function
	
	Public Function TestGetComponentPath(Denomination As String) As String
		GoExcel.Close
		MessageBox.Show("1", "Title")
		Dim RefRow = GoExcel.FindRow("3rd Party:ConfiguratorParameters", "FileReferences", "Description", "=", Denomination)
		
		MessageBox.Show("2", "Title")
		GoExcel.Close
		Dim ComponentPath = GoExcel.CellValue("3rd Party:ConfiguratorParameters", "FileReferences", "D" & RefRow)
		
		MessageBox.Show("3", "Title")
		GoExcel.Close
		
		MessageBox.Show("4", "Title")
		Return ComponentPath
	End Function
End Class

 

123