Hello there!
Can someone help me out?
I have make a small Excel VBA project, that opens a dwt file "FLW40_0"(see macro below) with a button. In this dwt I have managed a A3 layout with frame and a title block (see attached file). Now after opnening the dwt I what to insert the title Block that I define in excel file (see sheet "Schriftfeld"). The block schould be on layout down left.
Sub FLW40_0()
Dim ACAD As Object
Dim NewFile As Object
Dim MyAcadPath As String
Dim bReadOnly As Boolean
On Error Resume Next
Set ACAD = GetObject(, "ACAD.Application")
If (Err 0) Then
Err.Clear
Set ACAD = CreateObject("autocad.Application")
If (Err 0) Then
MsgBox "Could Not Load AutoCAD!", vbExclamation
End
End If
End If
'If you want to see AutoCAD on screen
ACAD.Visible = False
MyAcadPath = "U:\AutoCAD Vorlagen\FLW40_0.dwt"
bReadOnly = True
Set NewFile = ACAD.Documents.Open(MyAcadPath, bReadOnly)
If (NewFile Is Nothing) Then
ErrorMessage:
If NewFile = "False" Then End
MsgBox "Could not find the required spreadsheet that should be located at" & vbCr & MyAcadPath & vbCr & "Please rename or relocate the specified file as needed."
End
End If
'Close AutoCAD Process
'ACAD.Quit
Set ACAD = Nothing
Set NewFile = Nothing
End Sub
Best regards
Alex
FLW40.rar