Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
andy-axium
in reply to: Owner2229

I Have a very similar problem with some ilogic that is used to refresh values from an Excel list.

Anyone know what command is needed to replace the GoExcel statement?

This is the code in question.

SyntaxEditor Code Snippet

MultiValue.List("myFinishExt") = GoExcel.CellValues("I:\Templates 2018\myFinishExt.xlsx", "Sheet1", "A2", "A100")
MultiValue.List("myFinishInt") = GoExcel.CellValues("I:\Templates 2018\myFinishInt.xlsx", "Sheet1", "A2", "A100")
MultiValue.List("myMaterial") = GoExcel.CellValues("I:\Templates 2018\myMaterial.xlsx", "Sheet1", "A2", "A100")

I've used the solution from Owner2229
which successfully calls Excel, but I'm not sure what to use in place of GoExcel. to get my values?

 

Sub Main()
	Dim oExcelPath As String = "I:\Templates 2018\myFinishExt.xlsx"
	
	Dim oExcel As Object = CreateObject("Excel.Application")
	oExcel.Visible = False
	oExcel.DisplayAlerts = False
	Dim oWB As Object = oExcel.Workbooks.Open(oExcelPath)
	Dim oWS As Object = oWB.Sheets(1) 'Sheet 1
	oWS.Activate()

	'In this sample, when you're getting a cell, the row is first
	MsgBox("Cell A2 is: " & oWS.Cells(2, 1).Value)
	
	'oWB.Save() 'Use this to save it
	oWB.Close (True)
	oExcel.Quit
	oExcel = Nothing
End Sub