casual-rich
03-16-2009, 02:44 AM
hi im doing a project at uni and i have got to transfer date from access to excel do a calcualtion on a number of things in excel and then transfer the data back into access,
here is the code that i have done so far
Private Sub Transfer_To_Excel_Click()
Dim oApp As Object
Set oApp = CreateObject(Class:="Excel.Application")
oApp.Workbooks.Open "F:\Richard's Uni Sept 08-09\BSADC\assignment 3\samedayInvoice.xls"
oApp.Visible = True
oApp.Sheets("invoice").[E9].Value = Distance.Value
Set oApp = CreateObject(Class:="Excel.Application")
oApp.Workbooks.Open "F:\Richard's Uni Sept 08-09\BSADC\assignment 3\samedayInvoice.xls"
oApp.Visible = True
oApp.Sheets("invoice").[B9].Value = DeliveryNo.Value
End Sub
it transfers the data brill but jsut one problem it will open two excel documents what am I doing wrong please help me guys
any help will be brill
rich
here is the code that i have done so far
Private Sub Transfer_To_Excel_Click()
Dim oApp As Object
Set oApp = CreateObject(Class:="Excel.Application")
oApp.Workbooks.Open "F:\Richard's Uni Sept 08-09\BSADC\assignment 3\samedayInvoice.xls"
oApp.Visible = True
oApp.Sheets("invoice").[E9].Value = Distance.Value
Set oApp = CreateObject(Class:="Excel.Application")
oApp.Workbooks.Open "F:\Richard's Uni Sept 08-09\BSADC\assignment 3\samedayInvoice.xls"
oApp.Visible = True
oApp.Sheets("invoice").[B9].Value = DeliveryNo.Value
End Sub
it transfers the data brill but jsut one problem it will open two excel documents what am I doing wrong please help me guys
any help will be brill
rich