View Single Post
  #2   Report Post  
Posted to comp.lang.basic.visual.misc,microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default How to create Excel workbook from VB6?

Hi Kurt,

If you create an Excel instance, then you have access to all of the objects.
so as an example

Dim xlApp As Object
Dim xlWB As Object
Dim xlWS As Object

Set xlApp = CreateObject("Excel.Application")
xlApp.Visible = True ' or not as required
Set xlWB = xlApp.Workbooks.Add
Set xlWS = xlWB.Worksheets.Add
'etc.


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Kurt Remlin" wrote in message
m...
Hi,

What do I need to add to VB6 project to be able to create Excel'97
document on the fly?

How do I get access to the same objects that are available from Excel
itself via VBA?

Is there a good source with examples for such stuff?

Thank you.