-
Excel control...
I begin visual basic and I have a program to write and don't know how to begin. The prog must control an excel spreadsheet and make some treatment in it. I want to make this program extern from excel and thus don't want to use VBA...
Please help me ...
-
Go to Project References->Microsoft Excel x.0 Library
check it and now the Excel properties and methods are available to you in your VB Project. Now you can manipulate them as you like.
-
Does this method connect me directly to Excel ?
-
What I did a few years ago when I was first using VB with Excel was to use Excel's Auto Record Macro utility. I would turn on the Auto Record and then do what I wanted done. Then I would go to VBA and cut and paste the code into Visual Basic. Not all the code will work, but it at least helps to get you started with the format.
-
This will open a specific workbook in Excel.
Public xl As excel.Application
Public wb As excel.Workbook
Public ws As excel.Worksheet
Set xl = CreateObject("excel.application")
xl.Visible = True
Set wb = xl.Workbooks.Open(YourWorkbookPath)
To start a new workbook, change the last line to:
Set wb = xl.workbooks.add
-
Damonous,
That's what I first did too! It at lease gave me an idea of how to work with the EXCEL, WORD objects.
-
Ok, Thank you all for the answers...