Argument Not Optional HELP
CADForums.net Forum Index CADForums.net
Discussion of AutoCAD and other CAD software.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web cadforums.net
Argument Not Optional HELP

 
Post new topic   Reply to topic    CADForums.net Forum Index -> Customization
Author Message
montyzoomer
Guest





Posted: Wed Jan 12, 2005 3:30 pm    Post subject: Argument Not Optional HELP Reply with quote

I want to run the attached function, I was under the impression I could simply call the function from a sub routine but unfortunately I get an error saying 'Argument not optional'

the code is as follows
Function OpenAnyMode(strFileName As String) As AcadDocument

Dim varMode As Variant
Dim intCnt As Integer
Dim objDoc As AcadDocument

intCnt = Application.Documents.Count

If intCnt > 0 Then
varMode = ThisDrawing.GetVariable("SDI")

If varMode Then

Set objDoc = ThisDrawing.Open(strFileName)

Else

Set objDoc = Application.Documents.Open(strFileName)

End If

Else

Set objDoc = Application.Documents.Open(strFileName)

End If

Set OpenAnyMode = objDoc


End Function

It is probably something basic that I am missing - can any one point me in the right direction

Thanks

Ian

Back to top
Murph
Guest





Posted: Wed Jan 12, 2005 6:49 pm    Post subject: Re: Argument Not Optional HELP Reply with quote

That subject line sounds like my first marriage.

Murph
Back to top
Jason Piercey
Guest





Posted: Wed Jan 12, 2005 7:18 pm    Post subject: Re: Argument Not Optional HELP Reply with quote

montyzoomer,

In addition to any replies you might receive or already
received, you may find more information or responses
by posting future VBA related questions in the following
discussion group:

By NNTP discussion group reader at
news://discussion.autodesk.com/autodesk.autocad.customization.vba

By HTTP (web-based) interface at
http://discussion.autodesk.com/forum.jspa?forumID=33


Murph,

:)


--
Autodesk Discussion Group Facilitator



"montyzoomer" <nospam@address.withheld> wrote in message
news:31342590.1105525888849.JavaMail.jive@jiveforum1.autodesk.com...
Quote:
I want to run the attached function, I was under the impression I could
simply call the function from a sub routine but unfortunately I get an error

saying 'Argument not optional'
Quote:

the code is as follows
Function OpenAnyMode(strFileName As String) As AcadDocument

Dim varMode As Variant
Dim intCnt As Integer
Dim objDoc As AcadDocument

intCnt = Application.Documents.Count

If intCnt > 0 Then
varMode = ThisDrawing.GetVariable("SDI")

If varMode Then

Set objDoc = ThisDrawing.Open(strFileName)

Else

Set objDoc = Application.Documents.Open(strFileName)

End If

Else

Set objDoc = Application.Documents.Open(strFileName)

End If

Set OpenAnyMode = objDoc


End Function

It is probably something basic that I am missing - can any one point me in
the right direction

Thanks

Ian


Back to top
montyzoomer
Guest





Posted: Thu Jan 13, 2005 12:13 am    Post subject: Re: Argument Not Optional HELP Reply with quote

Thanks Murph, by the way most marriages are like that.

Thanks
Back to top
 
Post new topic   Reply to topic    CADForums.net Forum Index -> Customization All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




Windows Server DSP VoIP Electronics New Topics
Contact Us
Powered by phpBB