Quote:
Originally Posted by Zam Zam
Hi Shasur,
Could you guide or show me how to start?
Thank you
|
First add a reference to Microsoft Excel library in VB6.0. You can do that by Projects-->References-->Browse from Microsoft Excel and enable the check box
Once you add this all the Excel objects are available for your project
Now you need to Open and Excel instance. You can do that by
Dim oXL - Excel.Application
Set oXL = New Excel,Application
this opens a new Excel. You can make that visible by
oXl.Visible = True
and then you can open the workbook
Dim oWB as Excel.Workbook
Set oWB = oXL.Workbooks.Open (Path and Name of Workbook here)
now you can get the sheets
Dim oWS as worksheet
Set oWS = oWB.Worksheets(1)
from here you can add the logic to the worksheet .
once you are done. you need to close all you have opened
oWB.Save 'If you want to save the workbook
oWB.Close
oXL.Quit ' will close Excel
and set the objects to nothing
oWB =nothing
oXL = nothing
Follow each step and take your own time. Happy coding
Cheers
Shasur