The following code works to check if autocad is already running

[vba]
Dim AcadApp as AcadApplication

If AcadApp Is Nothing Then
Set AcadApp = CreateObject("AutoCAD.Application")
Else
Set AcadApp = GetObject(, "AutoCAD.Application")
End If
[/VBA]

great thanks to Tommy