View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
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