LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #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.








 
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 08:54 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"