Results 1 to 9 of 9

Thread: could not load some objects

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2005
    Posts
    9

    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

  2. #2
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    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:
    1. Private Sub btnPlotNow_Click() As Object
    2. 'Should be...
    3. 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 PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI 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

  3. #3

    Thread Starter
    New Member
    Join Date
    Oct 2005
    Posts
    9

    Re: could not load some objects

    Thanks for fast reply!

    Where would I put As Object?

  4. #4
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    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 PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI 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

  5. #5
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    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 PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI 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

  6. #6

    Thread Starter
    New Member
    Join Date
    Oct 2005
    Posts
    9

    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.

  7. #7

    Thread Starter
    New Member
    Join Date
    Oct 2005
    Posts
    9

    Re: could not load some objects

    PS the other user is running AutoCAD2004 and I am running 2005

  8. #8
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    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:
    1. Dim oApp As Autocad.Application ' Or how ever its done
    2. 'Should be...
    3. 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 PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI 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

  9. #9

    Thread Starter
    New Member
    Join Date
    Oct 2005
    Posts
    9

    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
  •  



Click Here to Expand Forum to Full Width