我正在尝试将混合字典键转储到 excel 工作表范围,但它没有按预期执行。这是我的代码。
Dim ExcelApplication As Excel.Application = New Excel.Application
Dim ExcelWorkbook As Excel.Workbook = ExcelApplication.Workbooks.Add
Dim SheetName As String = "Area Information"
Dim ExcelAreaBalanceWorksheet As Excel.Worksheet = CType(ExcelWorkbook.Sheets(1), Excel.Worksheet)
Dim BAGenByKVDictionary As New HybridDictionary
'code to populate hybriddictionary
Dim Rng As Excel.Range = ExcelAreaBalanceWorksheet.Range("a1", _
ExcelAreaBalanceWorksheet.Cells(BAGenByKVDictionary.Count, 1))
Rng.Value = ExcelApplication.WorksheetFunction.Transpose(BAGenByKVDictionary.Keys.ToString)
当我尝试将密钥传递给 Excel 时,它会传递System.Collections.Hashtable+ValueCollection
所有单元格而不是传递密钥。