P
Pradeep
Hello,
I have come across the following scenario and not able to make out the exact
reason for the behaviour.
I have a textbox in MS Access into which the name of workbook which needs to
be opened is keyed in. The following code is written in the click event of
the command button which opens the workbook. The workbook has links.
Dim objExcel As Excel.Application,objWrkBook as Excel.WorkBook
set objExcel= New Excel.Application
set objWrkBook= objExcel.WorkBooks.Open(txtWrkBkName.Value,0,True) - Fails
here
The above code fails at the user's end with an error Automation Error -
Server Threw An Exception. It however works fine on my system and colleagues
in my office.
I have changed the code to the following and it started working well at the
user's end too:
Dim objExcel As Object,objWrkBook as Object
set objExcel= CreateObject("Excel.Application")
set objWrkBook= objExcel.WorkBooks.Open(txtWrkBkName.Value,0,True)
The above code works fine at all the locations.
Ms Access Version - 2002
Ms Excel Version - 10
Both the user and developer ends are configured in such a way that they are
identical.
I would appreciate if someone could explain the reason for this behaviour.
Cheers,
Pradeep
I have come across the following scenario and not able to make out the exact
reason for the behaviour.
I have a textbox in MS Access into which the name of workbook which needs to
be opened is keyed in. The following code is written in the click event of
the command button which opens the workbook. The workbook has links.
Dim objExcel As Excel.Application,objWrkBook as Excel.WorkBook
set objExcel= New Excel.Application
set objWrkBook= objExcel.WorkBooks.Open(txtWrkBkName.Value,0,True) - Fails
here
The above code fails at the user's end with an error Automation Error -
Server Threw An Exception. It however works fine on my system and colleagues
in my office.
I have changed the code to the following and it started working well at the
user's end too:
Dim objExcel As Object,objWrkBook as Object
set objExcel= CreateObject("Excel.Application")
set objWrkBook= objExcel.WorkBooks.Open(txtWrkBkName.Value,0,True)
The above code works fine at all the locations.
Ms Access Version - 2002
Ms Excel Version - 10
Both the user and developer ends are configured in such a way that they are
identical.
I would appreciate if someone could explain the reason for this behaviour.
Cheers,
Pradeep