Results 1 to 8 of 8

Thread: Supporting various Excel versions

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Dec 2002
    Posts
    72

    Supporting various Excel versions

    I have an application that references Microsoft office 9.0, and I want it to support all versions of excel.
    I can't use createObject because I need the events on it and I don't want to create several setups to each version.
    Any suggestions ?

  2. #2
    PowerPoster lintz's Avatar
    Join Date
    Mar 2003
    Location
    The 19th Hole
    Posts
    2,697

    Re: Supporting various Excel versions

    I use CreateObject to open and manipulate info within Excel without any problem as my users range from Excel 95 (sign) to Excel XP.

    If you're unsure of a property add a reference to Microsoft office 9.0 then press F2 to open the Object Browser. (don't forget to remove the reference when you're done )

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Dec 2002
    Posts
    72

    Re: Supporting various Excel versions

    The only problem with createObject is that it doesn't support events.
    Do you have any solution for this problem ?

  4. #4
    PowerPoster lintz's Avatar
    Join Date
    Mar 2003
    Location
    The 19th Hole
    Posts
    2,697

    Re: Supporting various Excel versions

    What type of events are you attempting?

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

    Re: Supporting various Excel versions

    Quote Originally Posted by yarivp
    I have an application that references Microsoft office 9.0, and I want it to
    support all versions of excel.
    I take it that it was a type o, but you do mean MS Excel 2000
    correct? or are you programming against the Office commandbars or
    something?

    But as Lintz suggested, add the reference to create all the events and make
    it easier to code the properties,etc. Then change it to CreateObject and
    remove the reference.

    HTH
    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
    Lively Member
    Join Date
    Dec 2002
    Posts
    72

    Re: Supporting various Excel versions

    Thanks all but...
    Since I can't define the 'o' object with event, than the events are not supported.
    I want to use the OnChange event.
    Well ?

  7. #7

    Re: Supporting various Excel versions

    try
    Dim With Events Excel As Object
    inside a form or class module

  8. #8

    Thread Starter
    Lively Member
    Join Date
    Dec 2002
    Posts
    72

    Re: Supporting various Excel versions

    You cannot use "withevents" while difning an object

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