Ув. VBшники, помогите плииз!
есть модуль, написанный и работающий на шестерке, мне нужно перевеси его на .NET
модуль экспортирует данные из Автокада в Эксель
Public Module Module1
Attribute VB_Name = "Module1"
Sub AD_ExpData()
Dim I As short
Dim Obj_ As Object
Dim ObjPoint As AcadBlockReference
Dim S as Short
Dim AdoConn As Object
Dim fs As New Object
Dim TxtFile as VariantType
fs = CreateObject(Scripting.FileSystemObject)
Set TxtFile = fs.CreateTextFile("c:\AcadExportPoints.txt", True)
Kill ("C:\For_Import\Book1.xls")
FileCopy ("C:\For_Import\Book_templ.xls", "C:\For_Import\Book1.xls")
Set AdoConn = CreateObject("ADODB.Connection")
AdoConn.ConnectionString = "Provider=MSDASQL.1;Persist Security Info=False;Data Source=For_Import"
AdoConn.Open
'AdoConn.Execute ("Delete * From " & Chr(34) & "EXP_ACAD$" & Chr(34))
For Each Obj_ In ActiveDocument.ModelSpace
If TypeOf Obj_ Is AcadBlockReference Then
Set ObjPoint = Obj_
'MsgBox ObjPoint.InsertionPoint (0) & ";" & ObjPoint.InsertionPoint(1)
S = ObjPoint.InsertionPoint(0) & ";" & ObjPoint.InsertionPoint(1) & ";" & ObjPoint.InsertionPoint(2)
S = S & ";" & ObjPoint.Layer
TxtFile.WriteLine S
S = "Insert Into " & Chr(34) & "EXP_ACAD$" & Chr(34) & " (F7,F8,F9) " & " Values (" & ObjPoint.InsertionPoint(0) & "," & ObjPoint.InsertionPoint(1) & "," & ObjPoint.InsertionPoint(2) & ")"
AdoConn.Execute (S)
End If