Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default 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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default 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.



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




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




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








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




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



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
Creating a button to open a file ktpack[_2_] Excel Programming 2 September 14th 04 12:54 AM
button to open a file kolbydayne[_2_] Excel Programming 2 August 6th 04 03:36 AM
Create button to open a file kolbydayne Excel Programming 0 August 5th 04 04:55 PM
Button fails to call macro when open an Excel file from web Sam Excel Programming 1 June 30th 04 10:42 PM
VBA - on a button event, open another closed file, post changes, close file Fio Excel Programming 0 March 1st 04 01:08 PM


All times are GMT +1. The time now is 12:06 AM.

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"