【发布时间】:2020-02-27 13:44:35
【问题描述】:
我正在研究使用 VB.NET 在 Excel 中获取下拉单元格的所有可能值。基本上这是我的代码...
Dim excel As New Microsoft.Office.Interop.Excel.Application()
Dim pvw = excel.Workbooks.Open(TextBox1.Text)
Dim wb As Microsoft.Office.Interop.Excel.Workbook = pvw
Dim ws As Microsoft.Office.Interop.Excel.Worksheet = TryCast(wb.Sheets(1), Microsoft.Office.Interop.Excel.Worksheet)
'ws.Range("E9").Value is a dropdown cell and I want to loop through all the available values
wb.Close(True)
excel.Quit()
releaseObject(excel)
我只想知道下拉菜单中有哪些可能的值,以便验证数据。如何在 VB.NET 或 C# 中执行此操作?非常感谢。
【问题讨论】:
标签: c# .net excel vb.net office-interop