Visual Basic Customization

Reply
*Allaire, Yves
Message 1 of 3 (75 Views)

Object variable not set

75 Views, 2 Replies
12-18-2000 03:19 AM
Why this code gives me object variable not set, I use it inside Excel,
and AutoCAD R 14.01 is running...

Thanks

Dim acadObj As AcadApplication, points(0 To 2) As Double, mspace As
AcadModelSpace
Dim apoint As AcadPoint, test, cadDoc As AcadDocument
Dim nombrow As Integer, x As Integer
Set cadDoc = acadObj.ActiveDocument
*jwk
Message 2 of 3 (75 Views)

Re: Object variable not set

12-18-2000 03:41 AM in reply to: *Allaire, Yves
You need one more thing, like

set AcadObj=GetObject(AutoCAD.Application)

wkr, jwk
--
You ask a silly question, you get a technical answer...

Yves Allaire had the next bright idea:

>Why this code gives me object variable not set, I use it inside Excel,
>and AutoCAD R 14.01 is running...
>
>Thanks
>
>Dim acadObj As AcadApplication, points(0 To 2) As Double, mspace As
>AcadModelSpace
> Dim apoint As AcadPoint, test, cadDoc As AcadDocument
> Dim nombrow As Integer, x As Integer
> Set cadDoc = acadObj.ActiveDocument
>
>
*Allaire, Yves
Message 3 of 3 (75 Views)

Re:

12-18-2000 05:05 AM in reply to: *Allaire, Yves
Thanks, it works!!!

There is no way to bound at the Dim line, I though I heard this somewhere?

Thanks.

jwk a écrit :

> You need one more thing, like
>
> set AcadObj=GetObject(AutoCAD.Application)
>
> wkr, jwk
> --
> You ask a silly question, you get a technical answer...
>
> Yves Allaire had the next bright idea:
>
> >Why this code gives me object variable not set, I use it inside Excel,
> >and AutoCAD R 14.01 is running...
> >
> >Thanks
> >
> >Dim acadObj As AcadApplication, points(0 To 2) As Double, mspace As
> >AcadModelSpace
> > Dim apoint As AcadPoint, test, cadDoc As AcadDocument
> > Dim nombrow As Integer, x As Integer
> > Set cadDoc = acadObj.ActiveDocument
> >
> >

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Welcome to the new Autodesk Community!
If this is your first visit, click here to get started and make the most of the Community. Let us know what you think of the new experience in the Community Feedback Forum.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community