|
-
Oct 21st, 2005, 09:47 AM
#1
Thread Starter
New Member
could not load some objects
I receive the following error when I try to load a VB application into AutoCAD 2005. RobDog888 posted an answer (315175), I think my problem is I don't understand where the As Object declaration goes, as shown below give me an error.
Private Sub btnPlotNow_Click() As Object
FilePath = Module1.GetScriptFileLocation
If SaveScripts Then
Open FilePath & "\Batchplt.scr" For Output As 1
For dwg = 0 To dlgBatchPlot.dlgDrawingFileList.ListCount - 1
WriteScript2005 (1)
Next dwg
Close 1
End If
dlgBatchPlot.Hide
End Sub
-
Oct 21st, 2005, 11:31 AM
#2
Re: could not load some objects
Welcome to the Forums.
I havent done anything with automating AutoCad but I dont think that the button click signature is correct.
VB Code:
Private Sub btnPlotNow_Click() As Object
'Should be...
Private Sub btnPlotNow_Click()
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Oct 21st, 2005, 11:33 AM
#3
Thread Starter
New Member
Re: could not load some objects
Thanks for fast reply!
Where would I put As Object?
-
Oct 21st, 2005, 11:39 AM
#4
Re: could not load some objects
Why do you need "Object"?
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Oct 21st, 2005, 11:41 AM
#5
Re: could not load some objects
I found the link your referring to and are you using VB6 to automate AutoCad?
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Oct 21st, 2005, 12:03 PM
#6
Thread Starter
New Member
Re: could not load some objects
Yes I am. I had the program written and functional and when I loaded it into another users system it functioned, then when I tried to use it the next day I would get the "Could not load some objects because they are not available on this machine" error message. When I acknowledge the errors and can to the VB editor I can see some buttons are gone. If I run the program I get an error indicating a run time error of, get this, -2147352573 and when I select Debug the code that shows the form is displayed, all the form buttons except two are gone, and even though I see the form on the project tree the option of removing it is not available.
-
Oct 21st, 2005, 12:04 PM
#7
Thread Starter
New Member
Re: could not load some objects
PS the other user is running AutoCAD2004 and I am running 2005
-
Oct 21st, 2005, 12:13 PM
#8
Re: could not load some objects
Ok, now I see whats this issue. Your program reference to AC is 2005 and the users version is 2004 so it can not load the newer button objects on that system. You need to use latebinding (declaring your AC object variables as an Object). Then you need to make sure you only use controls, objects, properties, function, and methods that are available and supported in both versions or all versions you want to support in your app.
VB Code:
Dim oApp As Autocad.Application ' Or how ever its done
'Should be...
Dim oApp As Object
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Oct 21st, 2005, 01:46 PM
#9
Thread Starter
New Member
Re: could not load some objects
You 'da man RobDog!
Interestingly enough I found that I would loose objects surrounded by frames. I recreated my Dialog Box without them. When I got your latest I mad your changes, and added a frame and volia!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|