We help IT Professionals succeed at work.

Visual Basic Express 2010 & Excel

elitegroup2010 asked
I think this will be easy to answer but I know nothing about code so hopefully someone can help out.
I have an Excel workbook with 2 sheets (Sheet1, Sheet2, Sheet3).
I need Visual Basic Express 2010 code for a button to copy data from form to specific cells in Excel workbook.
For Example:
Copy data from Form1, Textbox1 to Workbook "Invoices" Sheet1, Range A7.

This is a new project and will be progressing such as:
Adding Access database to Excel Via VBE in order to create drop down menu(s)
Making the program secured by username and password for 30 days
Only able to view and print in pdf, hiding all spreadsheets and documents from Excel and Word
etc - but that more headaches to come, for now I just need to build the excel spreadsheet properly

Watch Question

Top Expert 2016



No it didnt work. The Microsoft DAO 3.6 Object Library is not in my references either as NET or COM though
Infotrakker Software
Most Valuable Expert 2012
Top Expert 2014
You need to use the Office/Excel Interops in .NET:


Basically, you add the namespace to your project, and then work with the objects as you typically did with the COM objects as shown in the link Rey provided.

This shows how to work with Interops:
Martin Liss"There is still no cure for the common birthday." ~John Glenn
Most Valuable Expert 2017
Distinguished Expert 2018

I've requested that this question be deleted for the following reason:

Not enough information to confirm an answer.
Scott McDaniel (EE MVE )Infotrakker Software
Most Valuable Expert 2012
Top Expert 2014

The two links I provided show exactly how to use the Interops with .NET to work with Excel. I think my comment should be accepted as a solution.