ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   File opening from Custome Toolbar (https://www.excelbanter.com/excel-programming/324174-file-opening-custome-toolbar.html)

WAYNE

File opening from Custome Toolbar
 
I would like to have a toolbar with seven buttons, each
of which would open a specific Excel file. I would use
fully qualified path names e.g., "\\FIL-NW02-06
\MPTTechTeamLeaders\8_Tech_Team_Scorecard\Reddy Team
Scorecards\[2005_Define_Scorecard_Hixson.xls"

The only difference in any of the path names is the last
part e.g., the Hixson in this one. So is there a way to
set a module-level string equal to the first part of the
path and append a different "end part" e.g. Hixson" to
get the full path name, depending on the button pushed?
I'm still new to this but having fun learning.

Thanks

Wayne

K Dales[_2_]

File opening from Custome Toolbar
 
To do what you want, just declare the variable for the common part of the
path as a constant in the declarations section of the module (before any subs
or functions):
Const MyFilePath as String =
"FIL-NW02-06\MPTTechTeamLeaders\8_Tech_Team_Scorecard\Reddy Team
Scorecards\[2005_Define_Scorecard_"
Then for each of your buttons, just append the rest; e.g. in the code for
your "Hixon" button;
SavePath = MyFilePath + "Hixon.xls"

"Wayne" wrote:

I would like to have a toolbar with seven buttons, each
of which would open a specific Excel file. I would use
fully qualified path names e.g., "\\FIL-NW02-06
\MPTTechTeamLeaders\8_Tech_Team_Scorecard\Reddy Team
Scorecards\[2005_Define_Scorecard_Hixson.xls"

The only difference in any of the path names is the last
part e.g., the Hixson in this one. So is there a way to
set a module-level string equal to the first part of the
path and append a different "end part" e.g. Hixson" to
get the full path name, depending on the button pushed?
I'm still new to this but having fun learning.

Thanks

Wayne



All times are GMT +1. The time now is 10:46 PM.

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