Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to load Excel startup files through code

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default 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






wrote in message
ups.com...
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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Toolbar should not load at startup sharkfoot Excel Discussion (Misc queries) 5 March 23rd 06 11:47 PM
Excel Startup Files Rhonda Excel Programming 4 December 6th 05 03:59 PM
Unable to load files from alternate startup folder Bill.Carlson Excel Discussion (Misc queries) 3 November 24th 05 03:36 PM
Automatically opening several Excel Files at startup Peo Sjoblom Excel Discussion (Misc queries) 0 June 8th 05 05:20 PM
Load Sheet2 on Startup?? Michael Vaughan Excel Programming 2 August 25th 04 04:36 AM


All times are GMT +1. The time now is 12:11 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"