Results 1 to 6 of 6

Thread: Excel Object remains in the memory

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2003
    Posts
    3

    Excel Object remains in the memory

    Hi All,

    I am doing VBA Programming in excel using office 97.I have created excel object as follows

    Dim objexcel As Excel.Application
    Dim objwb As Excel.Workbook
    Dim objsh As Excel.Worksheet
    Dim objshMI As Excel.Worksheet


    Inspite of closing the workbook and setting all the object to nothing when I press ctrl+Alt+del it always shows one excel object in the memory.
    I am closing the wb and setting the object to nothing in following order

    objwb.Close savechanges:=False
    objexcel.Application.Quit
    Set objexcel = Nothing
    Set objwb = Nothing
    Set objshMI = Nothing
    Set objsh = Nothing


    Thanks & Regards,

    Jignesh

  2. #2
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709
    Try changing the order.
    Code:
    objwb.Close savechanges:=False 
    objexcel.Application.Quit 
    Set objshMI = Nothing
    Set objsh = Nothing
    Set objwb = Nothing 
    Set objexcel = Nothing
    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
    Apr 2003
    Posts
    3
    Thanks for the reply but even after changing the order things are not working as required.

    One thing which I found out is that this problem occures only when the data file i.e. excel file is a big say around 2500 rows if I reduce this to 1000 rows everything works fine, there is no excel object in the memory.

    So is there any problem in working with large excel file.My system config is windows 98,256 MB RAM

    Thanks in advance

    Jignesh
    Thanks & Regards,

    Jignesh

  4. #4
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709
    Sound like a timing issue. When there are allot of records it is
    taking Excel longer to close and the code is destroying the
    objects before it should. Try adding a delay or check to allow
    Excel time to close.
    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

    Thread Starter
    New Member
    Join Date
    Apr 2003
    Posts
    3
    Hi,

    Thanks for the reply.But actually what is happening is that things are working fine on the OS2000.The problem happens only on 95 and 98 machine.So is there any issues while working with larges excel file on 95/98 OS.
    If any then please let me know and also if u know the workaround.

    Thanks in advance

    Jignesh
    Thanks & Regards,

    Jignesh

  6. #6
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709
    Are the 95/98 machines running the same version of Excel?
    If not check and make sure that all methods and properties are available.
    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

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