|
-
Nov 8th, 2000, 11:05 PM
#1
Thread Starter
Lively Member
Hi,
How can I output a report into an Excel spread sheet? Do I need a data control for it?
More importantly can I manipulate a spreadsheet cell by cell through a VB program?
Thanks in advance.
-
Nov 9th, 2000, 05:16 AM
#2
Fanatic Member
1. Don't know about the report - I never use the built in report engine - you can export to HTML or Text so Excel might be available. Check the DataReport ExportFormat meth in VB Help.
2. You can certainly manipulate Excel cell by cell from a VB program.
The trick is to use Excel to do it. Set a reference to the Excel Object Library and then use something like:
Code:
Dim oExcel as Excel.Application
Set oExcel = New Excel.Application
With oExcel
.LoadsaMethodsAvailable....
oExcel will give you access to all of Excels internal methods, Cells, Range etc...
Good luck.
Paul.
Not nearly so tired now...
Haven't been around much so be gentle...
-
Nov 9th, 2000, 11:00 AM
#3
Hyperactive Member
Here´s the code I use for Excel:
dim X aS OBJECT
Set X = CreateObject("Excel.Sheet")
X.Application.Visible = True
X.ActiveSheet.Rows(int_Row).Font.Bold = True 'fontbold
X.ActiveSheet.Cells(int_Row, Col).Formula = "'Hello"
X.ActiveSheet.Cells(int_Row, Col).Formula = 123
X.ActiveSheet.Cells.Font.Size = 8
X.ActiveSheet.Cells.Columns.AutoFit
X.SaveAs App.Path & "\myfile.xls"
To get more, save a macro in excel with what you want to do and open the code!
-
Nov 10th, 2000, 03:55 AM
#4
Thread Starter
Lively Member
Thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|