简单最好 发表于 2010-10-13 21:18:00

求助,关于“运行时错误55 文件以打开“

<p><font style="BACKGROUND-COLOR: #ffffff" face="Verdana">请教各位大侠,我编了一段程序,为什么运行时总显示 “运行时错误55 文件以打开”?</font></p>
<p><font style="BACKGROUND-COLOR: #ffffff" face="Verdana"></font>&nbsp;</p>
<p><font style="BACKGROUND-COLOR: #ffffff" face="Verdana"></font>&nbsp;</p>
<p><font style="BACKGROUND-COLOR: #ffffff" face="Verdana">Option Explicit</font></p>
<p><font style="BACKGROUND-COLOR: #ffffff" face="Verdana">Public Sub WriteTextFile()</font></p>
<p><font style="BACKGROUND-COLOR: #ffffff" face="Verdana">'获得文件路径<br/>Dim FileName As String, FileNumber As Integer<br/>FileName = "D:\2.txt"<br/>FileNumber = FreeFile()</font></p>
<p><font style="BACKGROUND-COLOR: #ffffff" face="Verdana">'打开文件<br/>Open FileName For Output As #FileNumber<br/>'将图形中所有的点的坐标保存到文件中<br/>&nbsp;Dim point As AcadPoint<br/>&nbsp;For Each point In ThisDrawing.ModelSpace<br/>&nbsp; Dim ptcoordinates As Variant<br/>&nbsp; ptcoordinates = point.Coordinates<br/>&nbsp; Write #FileNumber, ptcoordinates(0), ptcoordinates(1), ptcoordinates(2)<br/>&nbsp;Next point<br/>'关闭文件<br/>Close #FileNumber<br/>End Sub<br/></font></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
页: [1]
查看完整版本: 求助,关于“运行时错误55 文件以打开“