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 8518087
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T05:53:10+00:00 2026-06-11T05:53:10+00:00

I am trying to use C# to read excel file which has intermixed datatype.

  • 0

I am trying to use C# to read excel file which has intermixed datatype. Below is my connection string

var path = //xls location
var MyConnection = new OleDbConnection("provider=Microsoft.Jet.OLEDB.4.0; Data Source='" + path + "';Extended Properties='Excel 8.0;IMEX=1;'");

Research taught me that the complete Extended Properties in the connection string is supposed to be

Excel 8.0;IMEX=1;HDR=NO;TypeGuessRows=0;ImportMixedTypes=Text

However, I was informed that in connection string, the TypeGuessRows=0 has no meaning as the value will be taken directly from the Registry. Hence I need to modify the key manually and remove this property from connection string.

The particular registry key that was involved is:

Path:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Jet\4.0\Engines\Excel

Key:

TypeGuessRows

Original value = 8, in order to make it work change into = 0

Without doing this the IMEX won’t work even tough I add TypeGuessRows=0 into the Extended Properties.

However, my company forbids modifying registry value (strictly). I was told to find alternatives doing this.

In short:

Is there a way to read intermixed datatype excel file without having to modify any registry key (which is quite a common practice)?

Further topic:

Have you experienced this before? Are there possibilites that we can set TypeGuessRows=0 from the connection string only without having to modify the registry key (cancelling out my above premise).

If things don’t work out with OleDb:

Are there alternatives beside OleDb?

I appreciate any advise or suggestion.

Regards

  • 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-11T05:53:11+00:00Added an answer on June 11, 2026 at 5:53 am

    What you can do is to require having header in first row of Excel and set connection string to

    var MyConnection = new OleDbConnection("provider=Microsoft.Jet.OLEDB.4.0; Data Source='" + path + "';Extended Properties='Excel 8.0;HDR=No;IMEX=1;'");
    

    The key here is to set HDR=No (NO HEADER), however since you have header now each column will be treated as string (text), and you can do parsing or validation on each cell value. Of course you will need to skip or remove first row, since it contains header information.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to read an Excel file (.xls, I think Excel 2003 compatible) via
I was trying to use Apache POI (Version 3.6) to parse Excel .xls file,
i`ve been trying o use fscanf to read the an input file on my
I am trying to use the CSVhelper plugin to read an uploaded CSV file.
I am trying to read an excel spreadsheet through .NET (C#) Below is a
I am trying to use mmap to read a file using chunks of 1024.
I'm trying to read an excel file from C# using COM, and can get
I'm trying to read an Excel file (Office 2003). There is an Excel file
In PHP, I'm trying to read an Excel file using COM(): $rrc_app = new
i am trying to read an excel file in ruby and then take the

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.