请教各位大侠,我编了一段程序,为什么运行时总显示 “运行时错误55 文件以打开”?
Option Explicit
Public Sub WriteTextFile()
'获得文件路径 Dim FileName As String, FileNumber As Integer FileName = "D:\2.txt" FileNumber = FreeFile()
'打开文件 Open FileName For Output As #FileNumber '将图形中所有的点的坐标保存到文件中 Dim point As AcadPoint For Each point In ThisDrawing.ModelSpace Dim ptcoordinates As Variant ptcoordinates = point.Coordinates Write #FileNumber, ptcoordinates(0), ptcoordinates(1), ptcoordinates(2) Next point '关闭文件 Close #FileNumber End Sub
|