Find the xlstart folder

  • Thread starter Thread starter chrisrita
  • Start date Start date
C

chrisrita

Dear everybody:

I want to add a personal.xls to a computer without such a fil
automatically by Excel VBA, the problem is How can it figure out th
location of xlstart folder that is in use?

Looking forward to your help
 
Guess my search techniques just failed me. You already
have two good answers before I could say mine stinks.
 
you people are so kind and really good. thank you a lot. one mor
question to David, can macro automatically make another macro
 
Thank's Chip, I'm familiar with your vbe.htm but I guess not that
familiar that that would be the one to look for. I would have known
it would be on your site though.

But looking at why I was specifically asked about how to have a macro
create code, I looked back at the earlier response of mine. So...

Hi Chris/Rita,
By letting Excel do the work for you I meant recording a macro,
where you start recording (a macro) and do the things exactly
like you want the macro to do, and the recorder does everything
(usually) that can get you to the same result if you start with the
same conditions and worksheet data. Unfortunately what is
generated is very specific as exactly which cell is being changed,
moved, etc.

So by letting Excel do most of the work, the purpose is to see
what instructions "might" be used and generally one wants to
make their macro a lot more generic so that it can be used for
a lot of different situations the more general, usually the better,
because it means less work to do in the future.

The real reason I indicated to record a macro though was
so that the personal.xls workbook would be generated for
you in the correct place meaning within the XLSTART directory.

Once you have your personal.xls workbook (mine is actually
named slightly differently), you can add modules and code to that
manually -- that is what I really meant. Information on getting
started with macros in
Getting Started with Macros and User Defined Functions
http://www.mvps.org/dmcritchie/excel/getstarted.htm

Once you started working with macro, you might want something
with additional information in it:
Install Macros and User Defined Functions
http://www.mvps.org/dmcritchie/excel/install.htm

There is another kind of macro that is triggered on an event
such as manually entering data into a cell, switching worksheets,
selecting a cell, double clicking a cell, right-click, and more.
Event Macros, Worksheet Events and Workbook Events
http://www.mvps.org/dmcritchie/excel/event.htm
 
Thanks, David, Chip and Michel.

I developed a code that is useful to my work and some of my colleague
asked me for it. In order to install the function into others
computers i wrote another macro that can automatically add the code a
well as a button to their excels. Since the code is designed to b
added to the personal.xls which does not exist for every computer,
have to have the macro find out the xlstart folder so as to add th
file. Michel's solution fits my macro the best. and Michel figures ou
a brand new way that I will learn and try later. Millions of thanks t
David for your warm help and illumination.


Chri
 
Hi Chris,
Now that I know it is for other people, I think you would just
install your workbook into the XLSTART folder. I don't know
if that is what you originally had in mind and our replies just
kept leading away from the actual goal. Out replies were to
updating the personal.xls workbook. Since this is for others
you don't want to touch their file. If this is for a larger group
you might want to distribute it as an add-in.
 
Back
Top