Results 1 to 7 of 7

Thread: VBA interference between applications?

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2004
    Posts
    3

    VBA interference between applications?

    Hi everyone. I'm brand new here. I am a very casual VB user and I am looking forward to learning a lot here.

    I have been using VBA in Excel, and I recently started using VBA in another low volume specialized program. My question is: Is there just one VBA program that is shared among all programs that use VBA? How much interference is there? Is there some restriction on using only one at a time? I'm using VBA 6.3 on XP Pro.

    The reason I'm asking is that I swear I saw some strange results from this other program while a computationally-intensive (100% CPU usage) Excel macro was running.

    Thanks for any help.
    Last edited by Ralphy; Jul 19th, 2004 at 01:48 PM.

  2. #2
    Addicted Member
    Join Date
    Aug 2002
    Location
    Luton, UK
    Posts
    178
    using VBA in another low volume specialized program.
    No can do - and this, in effect, answers your query.

    You are probably using Visual Basic not Visual Basic for Applications. VBA is a cut down version of VB used solely with the Microsoft Office range of applications (although it can be stretched a bit to emulate keyboard entries in others). eg. Excel, Word etc.

    Unless your queries relate specifically to these applications you would probably be better posting on the Visual Basic message board.
    Regards
    BrianB
    -------------------------------

  3. #3

    Thread Starter
    New Member
    Join Date
    Jul 2004
    Posts
    3
    Thanks, BrianB. So is there any possibility of interference between VBA and VB?

  4. #4
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709
    You can automate office applications by using COM.
    Very basic example.
    In VB...

    VB Code:
    1. Option Explicit
    2. 'Add a reference to MS Excel xx.x
    3. 'Add a command button Command1
    4. Private moXL as  Excel.Application
    5.  
    6. Private Sub Command1_Click()
    7.  
    8.     Set moXL = New Excel.Application
    9.     moXL.Visible = True
    10.     moXL.WorkBooks.Add
    11.     '...
    12.  
    13. End Sub
    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

  5. #5
    Addicted Member
    Join Date
    Aug 2002
    Location
    Luton, UK
    Posts
    178
    interference between VBA and VB ?
    You would tend to use only one or the other. VB for standalone .exe - VBA only runs from within an MS Office application.
    Regards
    BrianB
    -------------------------------

  6. #6

    Thread Starter
    New Member
    Join Date
    Jul 2004
    Posts
    3
    Actually I found out that the low volume application does have VBA built-in. So my original question stands - what about Word vs. Excel, for instance?

  7. #7
    Addicted Member
    Join Date
    Aug 2002
    Location
    Luton, UK
    Posts
    178
    what about Word vs. Excel, for instance?
    As MS Office applications (along with Access, Powerpoint etc.) VBA is run from within code modules attached to the files. We use CreateObject from within these apps. to run another of the Office applications.

    VBA is part of MS Office -so no need to buy another application.

    Visual Basic can also be used to run them, but you have to use CreateObject from the start to create an instance of the Office application. We have to purchase this separately.

    I am using Excel all the time anyway, with and without code, and so would not wish to do anything with VB. I might consider using VB if I had to make a standalone application - when I believe that it is possible to supply to people who do not possess the MS Office applications. Not sure about this though.

    Hope these comments help.
    Regards
    BrianB
    -------------------------------

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