LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Variable menu with single "on-action" procedure

Hi all,

I have created an Excel Menu (CommandBars, Type:=msoControlPopup)
(using Excel 2003). Let's call this menu: "Accounting". The menu
"Accounting" contains a sub-menu item, called "User Manuals".
When a user starts Excel, a module lists all files in a given path,
let's say C:\Accounting\UserManuals\ , as well the files of each sub-
directory of this path.
Each file found is put on a worksheet with following information:

Column G: Path which has been searched
Column H: Length of the path name
Column I: Hyperlink to the file
Column J: Name of the file (without path)

Then:
For each file found within C:\Accounting\UserManuals\ , a module adds
the name of the file to the sub-menu "User Manuals" (using a for…each
loop)
For each sub-directory within C:\Accounting\UserManuals\, the module
creates a sub-menu item within "User Manuals", and then adds the name
of each file found within the sub-directory to it (again using a
for...each loop).

So at the end, the Accounting menu could look like this:

Accounting
Balance Sheet - opens an Excel template, mentionned here just as
example
Currency Rates - opens an Excel template, mentionned here just as
example
User Manuals
Manual for currency rates.pdf - file located in C:\Accounting
\UserManuals\
Manual for xyz.pdf - file located in C:\Accounting\UserManuals\
Balance Sheet - sub-directory in C:\Accounting\UserManuals\
Manual for balance sheet.pdf - file in C:\Accounting\UserManuals
\Balance Sheet\
Manual for abc.pdf - file in C:\Accounting\UserManuals\Balance
Sheet\
Booking Manuals - sub-directory in C:\Accounting\UserManuals\
Manual for trades.pdf
Manual for dividends.pdf

Now my problem: I would like to write a single module to call, so that
when a user selects any of the menu items within "User Manuals" or
within a sub-menu of "User Manuals", I can activate the corresponding
hyperlink of the file stored on the worksheet.
Can anyone help or suggest me something?

I hope my explanation is clear (not really easy to explain), I'm quite
new in the VBA world and even less familiar with the menu procedures.
Thanks in advance for any help.
 
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
"CELL("FILENAME") NOT UPDATE AFTER "SAVE AS" ACTION yossie6 Excel Discussion (Misc queries) 1 June 16th 08 12:16 PM
Multiple "source" workbooks linked to single "destination" workboo DAVEJAY Excel Worksheet Functions 1 September 17th 07 05:33 PM
Lost "File Menu" - now it's "Edit / View / Insert.." but no "F daves Excel Discussion (Misc queries) 3 April 24th 07 04:52 AM
use variable in Workbooks("book1").Worksheets("sheet1").Range("a1" Luc[_3_] Excel Programming 2 September 28th 05 08:37 PM
Menu Item Action Changes with "User" accessing file windsurferLA Excel Programming 1 June 15th 05 08:00 PM


All times are GMT +1. The time now is 11:47 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"