Re: How to load Excel startup files through code



When you start Excel through code, it doesn't run its startup
procedures, in order to minimize startup time. You'll have to run
startup procedures manually from your code. E.g,

Sub Workbook_Open()
Dim FName As String
Application.AddIns("Analysis ToolPak").Installed = True
FName = Dir(Application.Path & "XLStart\*.xls")
Do Until FName = ""
Workbooks.Open Application.Path & "XLStart\" & FName
FName = Dir()
Loop
FName = Dir(Application.AltStartupPath & "\*.xls")
Do Until FName = ""
Workbooks.Open Application.AltStartupPath & "\" & FName
FName = Dir()
Loop
End Sub

--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com






<e'kong.tse@xxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:1146666314.139144.94110@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi,

I'm trying to open up an Excel file (.xls) through code. That
file
uses some function located in a Excel Add-in file(.xla).
Everything is
fine if I open up that file directly in Excel and the startup
file is
specified under Tools->Options->General. However, when I try
to open
up the .xls file through code, the add-in file isn't open and
so I get
errors in my .xls file. Does anyone know how I can load the
startup
files through code?

Thanks!
E'Kong



.



Relevant Pages

  • Re: Excel 2007 Beta Compatibility Mode
    ... it opens all of the files in the folders. ... What you need to do is check your Startup folders and remove the files ... from the folders so they don't start when Excel starts. ... are your Excel startup locations. ...
    (microsoft.public.office.misc)
  • Re: Excel 2007 Beta Compatibility Mode
    ... MVP FAQ site: http://mvps.org/ ... having files in one of the Startup folders so each time Excel ... What you need to do is check your Startup folders and remove the ...
    (microsoft.public.office.misc)
  • Re: Excel after SP3
    ... This is a default list of things-to-do when Excel exhibits startup ... "Alternate startup file location". ... You might try disabling the Office plug in of NAV. ... In Windows 95/98 and ME ...
    (microsoft.public.excel.crashesgpfs)
  • Re: office assistant error
    ... There is a hotfix available to correct the error: ... Is there a way, maybe in the startup code of the database, to stop this ... For information, we use Excel 2000 and Word 2000, and Access 2003. ...
    (microsoft.public.office.misc)
  • Re: personal.xlsb, xl2007
    ... You’ll see the startup path returned ... When Excel think the file is corrupt it can disable the file. ... Choose "Disabled Items ... The message was checked by ESET Smart Security. ...
    (microsoft.public.excel.misc)

Loading