05-09-2018
12:31 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
05-09-2018
12:31 AM
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