VBA
Discuss AutoCAD ActiveX and VBA (Visual Basic for Applications) questions here.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Autocad error dialogue box

3 REPLIES 3
Reply
Message 1 of 4
antoney
223 Views, 3 Replies

Autocad error dialogue box

Hi All,
While running my code a window showing "AutoCAD encountered a problem and need to close" with two options send this error to autodesk or dont send.I put error handling everywhere but this window is showing and terminating my macro.I want to catch this error window through my code. Please help me to solve this problem.
Thanks in Advance
Anjana
3 REPLIES 3
Message 2 of 4
cadger
in reply to: antoney

could you post your code or the problem portion of it?
Message 3 of 4
Anonymous
in reply to: antoney

have your error handling write to a log file (txt file) (or whatever
external source ...db etc)
then you can read that after acad crashes
(when you won't be able to read the Immediate window) ...( if that's where
you're sending your debug info now)
hth
mark



wrote in message news:5935375@discussion.autodesk.com...
Hi All,
While running my code a window showing "AutoCAD encountered a problem and
need to close" with two options send this error to autodesk or dont send.I
put error handling everywhere but this window is showing and terminating my
macro.I want to catch this error window through my code. Please help me to
solve this problem.
Thanks in Advance
Anjana
Message 4 of 4
antoney
in reply to: antoney

Public Function OpenDocument() As Boolean

appObj = New AcadApplication
Application.DoEvents()

If bAbortFlag = True Then
Exit Function
End If

If appObj Is Nothing Then
WriteToErrorLog(CStr(nErrorDocNo), dwgName, "File Operation", "Application not initialised", "", "", "")
nErrorNo = nErrorNo + 1
OpenDocument = False
Else
Try
docObj = appObj.Documents.Open(fileName)
Catch ex As Exception
WriteToErrorLog(CStr(nErrorDocNo), dwgName, "File Operation", "Unable to Open the Input Drawing File", "", "", "")
nErrorNo = nErrorNo + 1
Exit Function
End Try
' Saving the File as Temporary Sheet.......
end if

End Function

In errorlog.xls file "Application not initialised", error is printed. But the problem is after that I am getting one more window. I dont want this window to appear. the program has to close that window and terminate the application objects.

Message was edited by: anjanact

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost