Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 414
Default Open file with custom button

I have created a custom button but need to write the macro to open a specific
file. I guess that this macro needs to be written to my profile/harddrive and
not within the actual file?

Also I cannot change the button, when I right-click, it just brings up the
normal list of toolbars to select/deselect.

Any help/guidance appreciated.
Cheers
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Open file with custom button



I guess that this macro needs to be written to my profile/harddrive


I'm not sure what you mean by that. To open a specific file, just use

Workbooks.Open "C:\Path\FileName.xls"

If you need to get your user profile directory, use

Workbooks.Open Environ("Userprofile") & "\SubFolder\Filename.xls"

or for a more robust solution, get the path to any of the user profile
directories using the code at
http://www.cpearson.com/excel/SpecialFolders.aspx .

Excel supports two sets of controls: those on the Forms toolbar and
those on the Controls toolbar. Which are you using?

Cordially,
Chip Pearson
Microsoft MVP
Excel Product Group
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)



On Tue, 18 Nov 2008 03:54:03 -0800, Andy
wrote:

I have created a custom button but need to write the macro to open a specific
file. I guess that this macro needs to be written to my profile/harddrive and
not within the actual file?

Also I cannot change the button, when I right-click, it just brings up the
normal list of toolbars to select/deselect.

Any help/guidance appreciated.
Cheers

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
Assigning a custom button hyperlink to file on toolbar in Vista autumn Setting up and Configuration of Excel 0 December 2nd 07 06:20 PM
Custom Button that will automatically open another application (SA leonardo Excel Programming 0 September 12th 07 02:36 PM
Macro call from custom button opens old file VBA = Fun Excel Programming 2 April 2nd 07 05:48 PM
button to open a file kolbydayne[_2_] Excel Programming 2 August 6th 04 03:36 AM
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 01:35 PM.

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"