| Author |
Message |
montyzoomer
Guest
|
Posted:
Wed Jan 12, 2005 3:30 pm Post subject:
Argument Not Optional HELP |
|
|
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 |
|
|
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 |
|
|
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 |
|
|
Thanks Murph, by the way most marriages are like that.
Thanks |
|
| Back to top |
|
 |
|
|
|
|