Click to See Complete Forum and Search --> : VB and Excel


GeorgeT
August 1st, 2001, 03:45 PM
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

Ghost308
August 1st, 2001, 03:51 PM
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!

GeorgeT
August 1st, 2001, 04:00 PM
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?