Hi Gurus,

I have a problem with the following segment of VBA code which I execute from MS-Excel. In this what I am trying to do is to
1. Open some two queries from a database (in this e.g., it is the sample database Northwind.mdb).
2. Select one of them and select all records in it.
3. Copy & paste it in the current Excel sheet.
4. Close the queries.
5. Close the database.
6. Quit MS-Access.

What is my Problem in this ?
It works fine the first time. But when I rerun the same segment changing my current cell to some other cell in either the same sheet or some other sheet, the code gives an error.
"Run-time error '462': The remote server machine does not exist or is unavailable".
The error comes in the line numbered 6.
-----------------

1 Sub testopendb3()
2 Dim objAccess as Object
3 set objAccess = GetObject _
4 ("C:\Program Files\Microsoft Office\Office\Samples\Northwind.mdb")
5 objAccess.Visible = true
6 DoCmd.OpenQuery "Category Sales for 1995", , acReadOnly
7 DoCmd.OpenQuery "Current Product List", , acReadOnly
8 DoCmd.SelectObject acQuery, "Category Sales for 1995", false
9 DoCmd.RunCommand acCmdSelectAllRecords
10 DoCmd.RunCommand acCmdCopy
11 ActiveSheet.Paste
12 DoCmd.Close acQuery, "Category Sales for 1995", acSaveNo
13 DoCmd.Close acQuery, "Current Product List", acSaveNo
14 CloseCurrentDatabase
15 Quit acQuitPrompt
16 End Sub



-----------------
Can somebody out there help ?

Thank you.
Kumar.