Visual Basic connect to Excel file

Posted on 2013-01-30
Last Modified: 2013-01-31
In order ro connect the Excel file will I need Excel installed on my computer.
See code below.

Private m_oXlsTests As ADODB.Connection
Private m_oRdsTest As ADODB.Connection

   Set m_oXlsTests = New ADODB.Connection
    With m_oXlsTests
        .Provider = "Microsoft.Jet.OLEDB.4.0"
        .Properties("Extended Properties") = "Excel 8.0"
        strFileName = App.path & "\Tests.xls"
        .Open strFileName
    End With
Question by:Idarac
LVL 85

Expert Comment

by:Rory Archibald
Comment Utility
No, that should not require Excel.

Accepted Solution

shorvath earned 500 total points
Comment Utility
You do not require Excel to be installed on a system in order to use ADO to read and write data in Excel workbooks.

For a detailed article using VB6 ADO and Excel see this link:

Author Closing Comment

Comment Utility

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now