Shortcut or button to open workbook

M

M.Siler

I have two workbooks I open every day. I'm try to see if there is away to
put two buttons in Excel that would open the selected workbook.

Any suggestions? Is this possible? Macros seem to be stored in a workbook
so that doesn't seem to help.
 
A

Alex

If you view those two workbooks everyday then you could
put them in the XLStart folder so that when you launch
Excel they are automatically.

Otherwise just write a simple Macro to open the selected
workbooks. Then customise the toolbar by adding two
buttons, one for each file. Then assign the relevant
Macro to each button so that when you click the button
the file is launched.
 
A

Alex

Here is more detail for you...

Open up a blank Excel sheet and launch VBA. Add a new
module to the 'PERSONAL.XLS' file. [You must use this to
make it universally applicable to all Excel files]

Type in the following code...

Sub Macro1()
ChDir "C:\Documents and Settings\YOUR NAME\Desktop"
Workbooks.Open Filename:="C:\Documents _ and
Settings\YOURNAME\Desktop\YOURFILE.xls"
End Sub

You will need to specify the correct file path. In the
above I am assuming the Excel file is on your desktop.
You will need to amend the above for your name, name of
Excel file, location on computer etc.

Once you have your Macro written, I suggest the following
as a guide.

On your Excel worksheet place the mouse over the <File>
menu and right-click. Then select customise. Click <File>
and where is shows the <File Open...> icon hold down CTRL
and drag the icon to create a copy. Place the duplicate
wherever you want it.

Now click the duplicate and select <Assign Macro>. Select
the Macro you just built. Also in the menu you can change
the display so that it reads, for example, Open XYZ Excel
file. The whole point is that you can now personalise
your toolbar. When finish just click anywhere on the
Excel spreadsheet.

Now whenever you open Excel you can go to the File menu
and there will be a specific command to open the Excel
sheet you use everyday. You could repeat this for the
other Excel sheet you have. Alternatively, just duplicate
the code of the original Macro so that your Macro is a
command to open both files.

This is just one way of solving your problem and making
life easier.

Please respond if you need further guidance. It is pretty
straightforward but if you haven't done this before it
may seem tricky. I check back to posts on a regular basis.

Alex
 
M

M.Siler

I think I can follow along with everything you've got here with one
question. You say to "open a blank Excel sheet and launch VBA. Add a new
module to the 'PERSONAL.XLS' file." Shouldn't I open PERSONAL.XLS rather
than the blank Excel Sheet? I did a seach on my system and didn't find
PERSONAL.XLS. Is this something I should save the black Excel sheet as? If
so where should I save it?


Alex said:
Here is more detail for you...

Open up a blank Excel sheet and launch VBA. Add a new
module to the 'PERSONAL.XLS' file. [You must use this to
make it universally applicable to all Excel files]

Type in the following code...

Sub Macro1()
ChDir "C:\Documents and Settings\YOUR NAME\Desktop"
Workbooks.Open Filename:="C:\Documents _ and
Settings\YOURNAME\Desktop\YOURFILE.xls"
End Sub

You will need to specify the correct file path. In the
above I am assuming the Excel file is on your desktop.
You will need to amend the above for your name, name of
Excel file, location on computer etc.

Once you have your Macro written, I suggest the following
as a guide.

On your Excel worksheet place the mouse over the <File>
menu and right-click. Then select customise. Click <File>
and where is shows the <File Open...> icon hold down CTRL
and drag the icon to create a copy. Place the duplicate
wherever you want it.

Now click the duplicate and select <Assign Macro>. Select
the Macro you just built. Also in the menu you can change
the display so that it reads, for example, Open XYZ Excel
file. The whole point is that you can now personalise
your toolbar. When finish just click anywhere on the
Excel spreadsheet.

Now whenever you open Excel you can go to the File menu
and there will be a specific command to open the Excel
sheet you use everyday. You could repeat this for the
other Excel sheet you have. Alternatively, just duplicate
the code of the original Macro so that your Macro is a
command to open both files.

This is just one way of solving your problem and making
life easier.

Please respond if you need further guidance. It is pretty
straightforward but if you haven't done this before it
may seem tricky. I check back to posts on a regular basis.

Alex
-----Original Message-----
I have two workbooks I open every day. I'm try to see if there is away to
put two buttons in Excel that would open the selected workbook.

Any suggestions? Is this possible? Macros seem to be stored in a workbook
so that doesn't seem to help.


.
 
G

Gord Dibben

How to work with Personal.xls.........

Personal.xls if a file where you store Macros that will be available to all
open workbooks.

If you do not have one(you won't if you have never recorded and/or stored a
macro in Personal.xls).......

Open any workbook.

Tools>Macro>Record New Macro

When dialog box comes up, select Personal Macro Workbook from "Store macro in"

Copy a cell and paste it or somesuch action.

Click on "Stop Recording" button.

You now have a Personal.xls.

Go to Window>Unhide and you will see Personal.xls. Do not unhide it.

Close Excel and you will be asked if you want to save changes to Personal.xls.
Click "Yes".

Your Personal.xls will be stored in XLSTART folder and open Hidden whenever
you start Excel.

You can add macros to Personal.xls by recording more or by opening the
VBEditor by hitting ALT + F11 and manually entering/copying/pasting code to a
module.

Gord Dibben Excel MVP

I think I can follow along with everything you've got here with one
question. You say to "open a blank Excel sheet and launch VBA. Add a new
module to the 'PERSONAL.XLS' file." Shouldn't I open PERSONAL.XLS rather
than the blank Excel Sheet? I did a seach on my system and didn't find
PERSONAL.XLS. Is this something I should save the black Excel sheet as? If
so where should I save it?


Alex said:
Here is more detail for you...

Open up a blank Excel sheet and launch VBA. Add a new
module to the 'PERSONAL.XLS' file. [You must use this to
make it universally applicable to all Excel files]

Type in the following code...

Sub Macro1()
ChDir "C:\Documents and Settings\YOUR NAME\Desktop"
Workbooks.Open Filename:="C:\Documents _ and
Settings\YOURNAME\Desktop\YOURFILE.xls"
End Sub

You will need to specify the correct file path. In the
above I am assuming the Excel file is on your desktop.
You will need to amend the above for your name, name of
Excel file, location on computer etc.

Once you have your Macro written, I suggest the following
as a guide.

On your Excel worksheet place the mouse over the <File>
menu and right-click. Then select customise. Click <File>
and where is shows the <File Open...> icon hold down CTRL
and drag the icon to create a copy. Place the duplicate
wherever you want it.

Now click the duplicate and select <Assign Macro>. Select
the Macro you just built. Also in the menu you can change
the display so that it reads, for example, Open XYZ Excel
file. The whole point is that you can now personalise
your toolbar. When finish just click anywhere on the
Excel spreadsheet.

Now whenever you open Excel you can go to the File menu
and there will be a specific command to open the Excel
sheet you use everyday. You could repeat this for the
other Excel sheet you have. Alternatively, just duplicate
the code of the original Macro so that your Macro is a
command to open both files.

This is just one way of solving your problem and making
life easier.

Please respond if you need further guidance. It is pretty
straightforward but if you haven't done this before it
may seem tricky. I check back to posts on a regular basis.

Alex
-----Original Message-----
I have two workbooks I open every day. I'm try to see if there is away to
put two buttons in Excel that would open the selected workbook.

Any suggestions? Is this possible? Macros seem to be stored in a workbook
so that doesn't seem to help.


.
 
D

Dave Peterson

I'd just add two shortcuts to my desktop.

Open explorer and find your files. rightclick (on each) and
choose "send to", then "desktop (create shortcut)"
 
Top