×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Using vb.net 2017 reading excel file 2016, into grid DataGridView

Using vb.net 2017 reading excel file 2016, into grid DataGridView

Using vb.net 2017 reading excel file 2016, into grid DataGridView

(OP)
I am unable to install "Microsoft.ACE.OLEDB.12.0" I have Office 365 which is downloaded.
Anyway I found the following code which read the rows into an array. then I thought I would load that into the grid.
The issue is the dates in the array are numbers such as 43810 = 12/11/2109 and 43782 = 11/13/2019. How can I convert the number into its date?
TIA

CODE

'Load grid with excel data
            Dim application = New Excel.Application()
            Dim workbook As Excel.Workbook = application.Workbooks.Open(gblExcelFilename)
            Dim worksheet As Excel.Worksheet = workbook.Sheets(1)

            Dim usedRange = worksheet.UsedRange
            Dim usedRangeAs2DArray As Object(,) = usedRange.val

            'workbook.Save()
            workbook.Close()
            application.Quit() 

DougP

RE: Using vb.net 2017 reading excel file 2016, into grid DataGridView

Hi,

The underlying value for dates in Excel are numbers that represent the number of days from the base reference, Dec 31, 1899.

Check out this link:
https://docs.microsoft.com/en-us/dotnet/api/system...

Skip,

glassesJust traded in my OLD subtlety...
for a NUance!tongue

"The most incomprehensible thing about the universe is that it is comprehensible" A. Einstein

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close