Discussion Locked

How to use Excel Graphs in VB

0 helpful
1 reply
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I am doing a Point of Sale in VB and have some graphing options for sales reports. I would like to use Excells control.

Thank you.

1 reply

by sl-campbell

Not sure if you want to actually use Excel's functions, or place an Excel Sheet on a VB form, or open an existing Excel file and do something with it.

To open a file:

Dim xlsApp As Excel.Application
Dim xlwb As Workbook
Dim myWs As Worksheet

Set xlsApp = New Excel.Application

xlsApp.Workbooks.Open _
FileName:="C:\Temp\SomeFile.xls"

Set myWbWB = xlsApp.ActiveWorkbook

xlsApp.Visible = True

Set myWs = xlwb.Sheets("Sheet1")

You could also use the OLE container to see, and edit, with-in a VB prg
an existing Excel WB.

This discussion is closed to new replies.