ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Button to open excel file (https://www.excelbanter.com/excel-programming/330136-button-open-excel-file.html)

Koataus

Button to open excel file
 
I'm currious how to create a button in excel with the function of opening
another specific excel file.

Thanks for any help!

Koataus
--
Do the one thing you think you cannot do. Fail at it. Try again. Do better
the second time. The only people who never tumble are those who never mount
the high wire. This is your moment. Own it.

Chip Pearson

Button to open excel file
 
Create a button, and assign the following macro to it.

Sub OpenFile()
Workbooks.Open filename:="C:\Whatever\book.xls"
End Sub


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



"Koataus" wrote in message
...
I'm currious how to create a button in excel with the function
of opening
another specific excel file.

Thanks for any help!

Koataus
--
Do the one thing you think you cannot do. Fail at it. Try
again. Do better
the second time. The only people who never tumble are those who
never mount
the high wire. This is your moment. Own it.




Harald Staff

Button to open excel file
 
Hi Koataus

Consider also a hyperlink. The wizard is in the Insert menu. This is your
moment. Own it.

HTH. Best wishes Harald

"Koataus" skrev i melding
...
I'm currious how to create a button in excel with the function of opening
another specific excel file.

Thanks for any help!

Koataus
--
Do the one thing you think you cannot do. Fail at it. Try again. Do better
the second time. The only people who never tumble are those who never

mount
the high wire. This is your moment. Own it.




Jim Thomlinson[_4_]

Button to open excel file
 
If you need to switch back and forth between the book that is running the
code and the book you just opened add this to Chips code.

Sub OpenFile()
dim wbk as workbook

set wbk = Workbooks.Open filename:="C:\Whatever\book.xls"
msgbox wbk.name
msgbox thisworkbook.name
End Sub

I hope that made sense. If not don't worry about it too much.
I am renting to own my moment. Sixteen more easy payments and it is mine...
:-)

--
HTH...

Jim Thomlinson


"Chip Pearson" wrote:

Create a button, and assign the following macro to it.

Sub OpenFile()
Workbooks.Open filename:="C:\Whatever\book.xls"
End Sub


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



"Koataus" wrote in message
...
I'm currious how to create a button in excel with the function
of opening
another specific excel file.

Thanks for any help!

Koataus
--
Do the one thing you think you cannot do. Fail at it. Try
again. Do better
the second time. The only people who never tumble are those who
never mount
the high wire. This is your moment. Own it.





Koataus

Button to open excel file
 
Thank you for your help! It worked great!
--
Do the one thing you think you cannot do. Fail at it. Try again. Do better
the second time. The only people who never tumble are those who never mount
the high wire. This is your moment. Own it.


"Chip Pearson" wrote:

Create a button, and assign the following macro to it.

Sub OpenFile()
Workbooks.Open filename:="C:\Whatever\book.xls"
End Sub


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



"Koataus" wrote in message
...
I'm currious how to create a button in excel with the function
of opening
another specific excel file.

Thanks for any help!

Koataus
--
Do the one thing you think you cannot do. Fail at it. Try
again. Do better
the second time. The only people who never tumble are those who
never mount
the high wire. This is your moment. Own it.





Koataus

Button to open excel file
 
Thank you all for your help! I was also wondering if there is a way to find
out a list of the (imbedded?) words to use, ex: (Workbooks.Open filename).
I'm just trying to learn about vba by jumping in head first. Thanks again
for everyones help!

Koataus
--
Do the one thing you think you cannot do. Fail at it. Try again. Do better
the second time. The only people who never tumble are those who never mount
the high wire. This is your moment. Own it.


"Jim Thomlinson" wrote:

If you need to switch back and forth between the book that is running the
code and the book you just opened add this to Chips code.

Sub OpenFile()
dim wbk as workbook

set wbk = Workbooks.Open filename:="C:\Whatever\book.xls"
msgbox wbk.name
msgbox thisworkbook.name
End Sub

I hope that made sense. If not don't worry about it too much.
I am renting to own my moment. Sixteen more easy payments and it is mine...
:-)

--
HTH...

Jim Thomlinson


"Chip Pearson" wrote:

Create a button, and assign the following macro to it.

Sub OpenFile()
Workbooks.Open filename:="C:\Whatever\book.xls"
End Sub


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



"Koataus" wrote in message
...
I'm currious how to create a button in excel with the function
of opening
another specific excel file.

Thanks for any help!

Koataus
--
Do the one thing you think you cannot do. Fail at it. Try
again. Do better
the second time. The only people who never tumble are those who
never mount
the high wire. This is your moment. Own it.





Tom Ogilvy

Button to open excel file
 
Slight typo/omission when modifying Chip's code:

Sub OpenFile()
dim wbk as workbook

set wbk = Workbooks.Open( filename:="C:\Whatever\book.xls")
msgbox wbk.name
msgbox thisworkbook.name
End Sub

--
Regards,
Tom Ogilvy

"Jim Thomlinson" wrote in message
...
If you need to switch back and forth between the book that is running the
code and the book you just opened add this to Chips code.

Sub OpenFile()
dim wbk as workbook

set wbk = Workbooks.Open filename:="C:\Whatever\book.xls"
msgbox wbk.name
msgbox thisworkbook.name
End Sub

I hope that made sense. If not don't worry about it too much.
I am renting to own my moment. Sixteen more easy payments and it is

mine...
:-)

--
HTH...

Jim Thomlinson


"Chip Pearson" wrote:

Create a button, and assign the following macro to it.

Sub OpenFile()
Workbooks.Open filename:="C:\Whatever\book.xls"
End Sub


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



"Koataus" wrote in message
...
I'm currious how to create a button in excel with the function
of opening
another specific excel file.

Thanks for any help!

Koataus
--
Do the one thing you think you cannot do. Fail at it. Try
again. Do better
the second time. The only people who never tumble are those who
never mount
the high wire. This is your moment. Own it.








All times are GMT +1. The time now is 01:38 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com