Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 246
Default Favorites.xla

Dick Krusleika, has an add-in, favorites.xla that adds a favorite list
to the File Menu. It limits the list to 9 files, which I have changed
to 15 files and thus, this line in the add-in fails to open any files
10 - 15:

With CommandBars.ActionControl
'Try to open the file
sCap = HandleAmp(Right(.Caption, Len(.Caption) - 3), _ False)
On Error Resume Next
Set wb = Workbooks.Open(sCap)
On Error GoTo 0

I need an or statement, such as:

Or sCap = HandleAmp(Right(.Caption, Len(.Caption) - 4), False)

but it doesn't work. How do I make it work? TIA

Greg

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Favorites.xla

Greg,

Leave the line you want to change alone. Instead, change

.Caption = "&" & lCtlCnt & " " & Cell.Text

To:

.Caption = "&" & IIf(lCtlCnt 9, Chr(lCtlCnt + 87), lCtlCnt) & " " &
Cell.Text

Also change the line

If Application.CountA(rFavs) = 9 Then

to

If Application.CountA(rFavs) = 15 Then

I still haven't figured out the problem with the single file not showing up,
but will work on that tomorrow.

HTH,
Bernie
MS Excel MVP


"GregR" wrote in message
oups.com...
Dick Krusleika, has an add-in, favorites.xla that adds a favorite list
to the File Menu. It limits the list to 9 files, which I have changed
to 15 files and thus, this line in the add-in fails to open any files
10 - 15:

With CommandBars.ActionControl
'Try to open the file
sCap = HandleAmp(Right(.Caption, Len(.Caption) - 3), _ False)
On Error Resume Next
Set wb = Workbooks.Open(sCap)
On Error GoTo 0

I need an or statement, such as:

Or sCap = HandleAmp(Right(.Caption, Len(.Caption) - 4), False)

but it doesn't work. How do I make it work? TIA

Greg



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 246
Default Favorites.xla

Bernie, not sure what you mean by "single file not showing up,". All 15
of my files did show up in the Favorites menu, I just couldn't open 10
- 15,because of the:

sCap = HandleAmp(Right(.Caption, Len(.Caption) - 3), _ False)

The -3 would remove &0[space] and would work fine, but for &00[space],
it would ask if I wanted to search for the file and not open, and thus
the -4, which I was trying to incorporate, which if I changed the above
to:

sCap = HandleAmp(Right(.Caption, Len(.Caption) - 4), _ False), files
10 - 15 would open but not 1 - 9.

Not sure I needed to clarify, but I hope it helps.

Greg

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Favorites.xla

Greg,

Then try code that handles both the 3 and 4 by looking for the space:

sCap = HandleAmp(Mid(.Caption, Instr(1, .Caption, " ")+1,Len(.Caption)), _
False)

What I meant by a single file not showing up is that if you have only one
file in your favorites, it doesn't show up. Not a problem when you have 15
files.

HTH,
Bernie
MS Excel MVP


"GregR" wrote in message
oups.com...
Bernie, not sure what you mean by "single file not showing up,". All 15
of my files did show up in the Favorites menu, I just couldn't open 10
- 15,because of the:

sCap = HandleAmp(Right(.Caption, Len(.Caption) - 3), _ False)

The -3 would remove &0[space] and would work fine, but for &00[space],
it would ask if I wanted to search for the file and not open, and thus
the -4, which I was trying to incorporate, which if I changed the above
to:

sCap = HandleAmp(Right(.Caption, Len(.Caption) - 4), _ False), files
10 - 15 would open but not 1 - 9.

Not sure I needed to clarify, but I hope it helps.

Greg



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 246
Default Favorites.xla

Bernie, thank you very much

Greg

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
Favorites trvlnmny New Users to Excel 0 April 1st 11 06:26 PM
What's your favorites? Connor[_2_] Excel Discussion (Misc queries) 12 March 7th 09 07:23 PM
favorites rm20005rm Excel Discussion (Misc queries) 1 November 3rd 07 08:17 PM
Favorites in Excel sphbecker Setting up and Configuration of Excel 3 June 1st 06 11:10 PM
Adding to Favorites George Burdell[_2_] Excel Programming 1 September 9th 04 11:20 PM


All times are GMT +1. The time now is 07:30 AM.

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"