|
-
Mar 14th, 2007, 02:41 AM
#1
Thread Starter
Member
Using Excel To Create Reports
could you pls show me how to export to excel
Last edited by Hack; Mar 14th, 2007 at 08:16 AM.
-
Mar 14th, 2007, 08:17 AM
#2
Re: Using Excel To Create Reports
I've taken your post from an old, old thread in the database section and moved it into its own, new, thread.
What platform will you be using, VB6 or VB.NET?
-
Mar 26th, 2007, 02:56 AM
#3
Thread Starter
Member
Re: Using Excel To Create Reports
Hi Hack sorry for reply late because i need to settle the Rent interface first before i go into printing invoice for customer . so what is the best way of doing it by excel or by access. with my rent interface there is a print invoice button when the user click on that button it will print the invoice to customer
in the invoice have , customer name, address telphone , invoice number, Item that they rent and so on . i want it a simple way so i try out with excel but excel doesn't show the data in the excel sheet pls help. below are my code
[vb] Code:
Dim objexcel as object
Set objexcel= createobject(“Excel.sheet”)
objexcel.application.cell(3,9).value=text1.text ‘invoice number
objexcel.application.cell(3,12).value=text2.text ‘customer name
-
-
-
objexcel.application.visible=true
Last edited by songoku; Mar 26th, 2007 at 03:08 AM.
-
Mar 26th, 2007, 08:09 AM
#4
Re: Using Excel To Create Reports
Your code isn't quite right.. see my Excel tutorial (link in my signature) for the correct methods.
-
Apr 6th, 2007, 12:52 AM
#5
Thread Starter
Member
Re: Using Excel To Create Reports
Hi Si _the_geek thanks i have try out it work. now i have another problem is where i need to print something like his
Code:
Movie id Movie Name Price
SD1 Superman 9
MT1 Matrix 9
but what i get is something like this
Code:
Movie id Movie Name P rice
SD1 MT1
Superman Matrix
9 9
pls help me below is my coding
vb Code:
Dim objexcel As Excel.Application
Dim objsheet As Excel.Worksheet
Dim objbook As Excel.Workbook
Set objexcel = New Excel.Application
Set objbook = objexcel.Workbooks.Add
Set objsheet = objbook.Worksheets(1)
objexcel.Visible = True
For i = 0 To titlecount - 1
objsheet.Cells(1, i + 2).Value = List1.List(i)
objsheet.Cells(1, 2, i + 1).Value = List2.List(i)
objsheet.Cells(3 i + 1).Value = List3.List(i)
Next
Last edited by si_the_geek; Apr 6th, 2007 at 08:52 AM.
Reason: added code tags to keep data format
-
Apr 6th, 2007, 08:56 AM
#6
Re: Using Excel To Create Reports
It looks like you have got the .Cells method a bit confused.. you should be specifying two parameters, which are the Row and Column numbers.
As the row number in this case should be specified based on the loop counter, I presume this is what you want:
Code:
objsheet.Cells(i + 2, 1).Value = List1.List(i)
objsheet.Cells(i + 2, 2).Value = List2.List(i)
objsheet.Cells(i + 2, 3).Value = List3.List(i)
..and I hope you have more code than you are showing - as you aren't releasing the object variables, etc.
-
Apr 6th, 2007, 08:11 PM
#7
Thread Starter
Member
Re: Using Excel To Create Reports
thanks si_the_geek i will try it out and let you know later
-
Apr 7th, 2007, 08:44 PM
#8
Thread Starter
Member
Re: Using Excel To Create Reports
Hi Si_thee_geek it work perfectly
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
|