CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: VB and Excel

  1. #1
    Join Date
    Oct 2000
    Posts
    58

    VB and Excel

    Could you help me to find out how to start Excel with Add-in from VB. This code doesn't work.

    Set Application = CreateObject("Excel.application")
    Application.Visible = True
    Application.Workbooks.Add
    Application.AddIns.Add strTemplate, False
    Application.AddIns.Installed = True

    Thanks


  2. #2
    Join Date
    Jun 2001
    Location
    Memphis, TN
    Posts
    146

    Re: VB and Excel

    This is just a guess, but are you sure you can use the term Application as a variable name in this case? Try it with this and see what happens (i haven't tested this)


    set x = CreateObject("Excel.application")
    x.Visible = true
    x.Workbooks.Add
    x.AddIns.Add strTemplate, false
    x.AddIns.Installed = true




    Good luck!



  3. #3
    Join Date
    Oct 2000
    Posts
    58

    Re: VB and Excel

    Thanks, Application or x doesn't work. I does open Excel, it does add add-in, it does set it to True, but it does not enable macros, so Auto_run macro doesn't run. Any ideas why?


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

Featured