Run-time error 432 when running VBA script

I am trying to run a VBA script in Autocad and I get the following error: “Automation Error – element not found” Clicking on Debug highlights this line:
Set xlbook = GetObject(“C:75094-LB-06 MX-sv.xlsx”)
I can see that the file is present in the folder.

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>Public acad As Object
Public acadapp As AcadApplication, AcadDoc As AcadDocument
Public doc As Object
Public ms As Object
Public ss As Object
Public ssnew As Object
Public ssnew2 As Object
Public Theatts As Variant
Public Theatts2 As Variant
Public MsgBoxResp As Integer
Private Sub CommandButton1_Click()
Dim BlkG(0) As Integer
Dim ro As Integer
Dim TheBlock(0) As Variant
Dim Pt1(0 To 2) As Double
Dim Pt2(0 To 2) As Double
Dim insertionPnt(0 To 2) As Double
Dim xlapp As Excel.Application
Dim xlbook As Excel.Workbook
Dim xlSheet As Excel.Worksheet
'Set xlbook = GetObject("C:75094-LB-06 MX-sv.xlsx")
Set xlbook = GetObject("C:75094-LB-06MX-SV.xlsx")
Set xlSheet = xlbook.Sheets("04-LB-06 MX")
Set xlapp = xlbook.Parent
xlapp.DisplayAlerts = False
'set reference to workbook
ro = 2
'declare local variables
Dim dwgName As String
Dim vtag As String
'vtag = "c:7509" & sh.Cells(ro, 5) & ".dwg"
Debug.Print vtag
testflZS
xlbook.Close savechanges:=False
'save the changes in Excel
xlapp.Quit
'quit Excel
Set xlSheet = Nothing
Set xlbook = Nothing
Set axlapp = Nothing
'clean up
ThisDrawing.Save
ThisDrawing.Close
xlapp.DisplayAlerts = True
End Sub
Private Sub CommandButton3_Click()
Dim BlkG(0) As Integer
Dim ro As Integer
Dim ssnew As Object
Dim TheBlock(0) As Variant
Dim Pt1(0 To 2) As Double
Dim Pt2(0 To 2) As Double
Dim insertionPnt(0 To 2) As Double
Dim xlapp As Excel.Application
Dim xlbook As Excel.Workbook
Dim xlSheet As Excel.Worksheet
Set xlbook = GetObject("C:75094-LB-06 MX-sv.xlsx")
Set xlSheet = xlbook.Sheets("04-LB-06 MX")
Set xlapp = xlbook.Parent
xlapp.DisplayAlerts = False
'set reference to workbook
</code>
<code>Public acad As Object Public acadapp As AcadApplication, AcadDoc As AcadDocument Public doc As Object Public ms As Object Public ss As Object Public ssnew As Object Public ssnew2 As Object Public Theatts As Variant Public Theatts2 As Variant Public MsgBoxResp As Integer Private Sub CommandButton1_Click() Dim BlkG(0) As Integer Dim ro As Integer Dim TheBlock(0) As Variant Dim Pt1(0 To 2) As Double Dim Pt2(0 To 2) As Double Dim insertionPnt(0 To 2) As Double Dim xlapp As Excel.Application Dim xlbook As Excel.Workbook Dim xlSheet As Excel.Worksheet 'Set xlbook = GetObject("C:75094-LB-06 MX-sv.xlsx") Set xlbook = GetObject("C:75094-LB-06MX-SV.xlsx") Set xlSheet = xlbook.Sheets("04-LB-06 MX") Set xlapp = xlbook.Parent xlapp.DisplayAlerts = False 'set reference to workbook ro = 2 'declare local variables Dim dwgName As String Dim vtag As String 'vtag = "c:7509" & sh.Cells(ro, 5) & ".dwg" Debug.Print vtag testflZS xlbook.Close savechanges:=False 'save the changes in Excel xlapp.Quit 'quit Excel Set xlSheet = Nothing Set xlbook = Nothing Set axlapp = Nothing 'clean up ThisDrawing.Save ThisDrawing.Close xlapp.DisplayAlerts = True End Sub Private Sub CommandButton3_Click() Dim BlkG(0) As Integer Dim ro As Integer Dim ssnew As Object Dim TheBlock(0) As Variant Dim Pt1(0 To 2) As Double Dim Pt2(0 To 2) As Double Dim insertionPnt(0 To 2) As Double Dim xlapp As Excel.Application Dim xlbook As Excel.Workbook Dim xlSheet As Excel.Worksheet Set xlbook = GetObject("C:75094-LB-06 MX-sv.xlsx") Set xlSheet = xlbook.Sheets("04-LB-06 MX") Set xlapp = xlbook.Parent xlapp.DisplayAlerts = False 'set reference to workbook </code>
Public acad As Object
Public acadapp As AcadApplication, AcadDoc As AcadDocument
Public doc As Object
Public ms As Object
Public ss As Object
Public ssnew As Object
Public ssnew2 As Object
Public Theatts As Variant
Public Theatts2 As Variant
Public MsgBoxResp As Integer

Private Sub CommandButton1_Click()
Dim BlkG(0) As Integer
Dim ro As Integer
Dim TheBlock(0) As Variant
Dim Pt1(0 To 2) As Double
Dim Pt2(0 To 2) As Double
Dim insertionPnt(0 To 2) As Double
Dim xlapp As Excel.Application
Dim xlbook As Excel.Workbook
Dim xlSheet As Excel.Worksheet
'Set xlbook = GetObject("C:75094-LB-06 MX-sv.xlsx")
Set xlbook = GetObject("C:75094-LB-06MX-SV.xlsx")
Set xlSheet = xlbook.Sheets("04-LB-06 MX")
Set xlapp = xlbook.Parent
xlapp.DisplayAlerts = False

'set reference to workbook

ro = 2
'declare local variables

 Dim dwgName As String
 Dim vtag As String
 'vtag = "c:7509" & sh.Cells(ro, 5) & ".dwg"
 Debug.Print vtag
 
testflZS
 
xlbook.Close savechanges:=False
'save the changes in Excel

xlapp.Quit
'quit Excel
 
Set xlSheet = Nothing
Set xlbook = Nothing
Set axlapp = Nothing
'clean up

ThisDrawing.Save
ThisDrawing.Close
xlapp.DisplayAlerts = True
End Sub
Private Sub CommandButton3_Click()
Dim BlkG(0) As Integer
Dim ro As Integer
Dim ssnew As Object
Dim TheBlock(0) As Variant
Dim Pt1(0 To 2) As Double
Dim Pt2(0 To 2) As Double
Dim insertionPnt(0 To 2) As Double
Dim xlapp As Excel.Application
Dim xlbook As Excel.Workbook
Dim xlSheet As Excel.Worksheet
Set xlbook = GetObject("C:75094-LB-06 MX-sv.xlsx")
Set xlSheet = xlbook.Sheets("04-LB-06 MX")
Set xlapp = xlbook.Parent
xlapp.DisplayAlerts = False
'set reference to workbook

I tried to run the script and I expected it to generate some Autocad drawings.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật