Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9152367
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T12:01:29+00:00 2026-06-17T12:01:29+00:00

I am attempting to dump hybrid dictionary keys to an excel worksheet range, but

  • 0

I am attempting to dump hybrid dictionary keys to an excel worksheet range, but it is not performing as expected. Here’s my code.

    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)

When I try to pass the keys to Excel, it passes System.Collections.Hashtable+ValueCollection for all cells instead of passing the keys.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T12:01:31+00:00Added an answer on June 17, 2026 at 12:01 pm

    This is because ToString() on the HybridDictionary does not override the base Object implementation, which is defined, in part as:

    The default implementation of the ToString method returns the fully
    qualified name of the type of the Object…

    In order to retrieve the keys as an array of strings, there are numerous methods, but I always prefer the most straightforward approach, a loop:

        Dim sbKeys As New System.Text.StringBuilder(1000)
    
        For Each oKey As Object In BAGenByKVDictionary.Keys
            ' Produce a comma=separated list
            If sbKeys.Length <> 0 Then
                sbKeys.Append(",")
            End If
            sbKeys.Append(oKey.ToString())
        Next
    
        Rng.Value = ExcelApplication.WorksheetFunction.Transpose(sbKeys.ToString())
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm attempting to dump variable property information to a simple string but when it
While attempting to get an old svn dump of a project under git control,
I have a Excel .CSV file I'm attempting to read in with DictReader. All
I am attempting to parse a Wikipedia SQL dump with the Python regular expressions
I'm attempting to format data so that my json code can read it properly.
I'm attempting to get the referrer URI in Kohana 3.2 using the following code:
I'm attempting to do a SVN repository dump from a command-line. I have both
Perhaps I am attempting to do something I ought not. I'm running a block
I'm attempting to dump a bunch of get functions into a spreadsheet using cfspreadsheet
Attempting to build a C# NPAPI plugin I have found a tutorial which describes

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.