Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Run time Error 1004

Status
Not open for further replies.

Ammai

Programmer
Mar 20, 2002
6
GB
My Excel Macro queries a DB2 database and populates the results(report) in excel sheet.The macro works fine for majority of report requests, but for some reports it gives the error no : 1004 and crashes without proceeding.It also says unable to set orientation property to the pivot field class.I couldn't debug as when i step into the macro it crashes.If anyone can shed some light into thsi it would be great.
Thanx
Ammai
 
According to what Microsoft says, you maybe need to install Text to Speech feature. The error handler can be used as a temporary solution.
For example

ErrorHandler:
If Err.Number = 1004 Then
Resume Next
End If

or

ErrorHandler:
If Err.Number = 1004 Then
MsgBox "Unable to process your request."
End If

 
I'll try this out.Any other suggestions?

Thanks
Ammai
 
Can you post the exact description of the error message? It can be:
Run-time error '1004': Application-defined or object-defined error
or
Run time error 1004: Add method of <collection> class failed (this one can cause Excel to crash)
or
Run-time error '1004':
Unable to set the Focus property of the DialogSheet class
... and many more.
 
Hi,
It says:
RUN TIME ERROR 1004
UNABLE TO SET THE ORIENTATION PROPERTY OF THE PIVOT FIELD CLASS and then crashes.

Thanx
Ammai
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top