OK so i have this problem i am using automation to manipluate data from vb to an excel worksheet, that works fine the problem is that i need to open the application itself after processing this data....so that the user can see the actual workbook. I have no idea how i can run the application from VB ..... any ideas
CODE
Dim xl As New Excel.Application 'opens an excel application
Dim xlsheet As Excel.Worksheet
Dim xlwbook As Excel.Workbook
Dim a
Set xlwbook = xl.Workbooks.Open("E:\Ass2 Programming\Timesheet.xls")
Set xlsheet = xlwbook.Sheets.Item(1)
a = 5 'row number to start at in excel sheet
If Not dta_emp.Recordset.EOF Then dta_emp.Recordset.MoveFirst 'moves to the first record
Do While Not dta_emp.Recordset.EOF
xlsheet.Cells(a, 1) = txtfname.Text
xlsheet.Cells(a, 2) = txtrate.Text
xlsheet.Cells(a, 3) = DateDiff("h", mi.Text, mo.Text) 'difference between the sign in and out by hours
xlsheet.Cells(a, 4) = DateDiff("h", ti.Text, tot.Text)
xlsheet.Cells(a, 5) = DateDiff("h", wi.Text, wo.Text)
xlsheet.Cells(a, 6) = DateDiff("h", thi.Text, tho.Text)
xlsheet.Cells(a, 7) = DateDiff("h", fi.Text, fo.Text)
xlsheet.Cells(a, 8) = DateDiff("h", sai.Text, sao.Text)
xlsheet.Cells(a, 9) = DateDiff("h", si.Text, so.Text)
xlwbook.Save
a = a + 1
dta_emp.Recordset.MoveNext
Loop
xlwbook.Sheets.PrintPreview ' PRINT PREVIEW !!!!!! DOESNT WORK
xl.ActiveWorkbook.Close False, "Timesheet.xls" 'saves the file
xl.Quit 'quits the application
i would preferably like to open the file via a print preview, but i gave up on that lol
thanx again peeps