Open Interactive Guide with VBA

User avatar
sobershea
2StarLounger
Posts: 184
Joined: 08 Feb 2010, 23:37
Location: Howell, Michigan USA

Open Interactive Guide with VBA

Post by sobershea »

There is an Interactive Guide for any of the 2010 Office apps which I downloaded and installed. The Guide helps with finding menu and toolbar commands on the Ribbon. The installed path is
C:\Program Files (x86)\Microsoft Silverlight\sllauncher.exe 3614527491.office.microsoft.com.

What I would like to do is create a macro that runs the guide. I could then put the macro on the Quick Access Toolbar for (duh!) quick access. :evilgrin:
I tried:

Code: Select all

Sub DoBrowse2()
     ActiveWorkbook.FollowHyperlink _
      Address:="C:\Program Files (x86)\Microsoft Silverlight\sllauncher.exe 3614527491.office.microsoft.com", _
      NewWindow:=True
End Sub
but I get a Run-time error '-2147221014 (800401ea)':
Cannot open the specified file.

I suspect this is because the Interactive Guide is using Silverlight. Does anyone know how I could run the Interactive Guide from within Excel?

TIA
Sherry

User avatar
HansV
Administrator
Posts: 78488
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Open Interactive Guide with VBA

Post by HansV »

Does this work?

Code: Select all

Sub DoBrowse2()
     Shell """C:\Program Files (x86)\Microsoft Silverlight\sllauncher.exe"" 3614527491.office.microsoft.com"
End Sub
Best wishes,
Hans

User avatar
sobershea
2StarLounger
Posts: 184
Joined: 08 Feb 2010, 23:37
Location: Howell, Michigan USA

Re: Open Interactive Guide with VBA

Post by sobershea »

It does work except the Interactive Guide window that opens, opens minimized to the task bar and doesn't fully "run" until I select it. Which is still better than what I was able to accomplish. I'm curious about the number of quotes you used as well as the Shell command. I can see the the quotes seem to "match" (same number right and left), but I'm not sure why you need 3 sets. The original code that I used only had one pair. Was that the reason I was getting the error?
:scratch:
Sherry

User avatar
HansV
Administrator
Posts: 78488
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Open Interactive Guide with VBA

Post by HansV »

FollowHyperlink can't be used to open an application and a file with it. The Shell instruction can be used for that, but it expects paths that contain spaces to be enclosed in quotes. Because the argument to Shell is already a quoted string, we can't simply use quotes within it. To use a quote " within a quoted string, we must double it to "".

To open the guide in a normal window, use

Shell """C:\Program Files (x86)\Microsoft Silverlight\sllauncher.exe"" 3614527491.office.microsoft.com", vbNormalFocus

To open it in a maximized window, use

Shell """C:\Program Files (x86)\Microsoft Silverlight\sllauncher.exe"" 3614527491.office.microsoft.com", vbMaximizedFocus
Best wishes,
Hans

User avatar
StuartR
Administrator
Posts: 12605
Joined: 16 Jan 2010, 15:49
Location: London, Europe

Re: Open Interactive Guide with VBA

Post by StuartR »

sobershea wrote:... I'm curious about the number of quotes you used...
This looks like the normal way to include a quote inside another one.

The command passed to Shell has one quote mark at the beginning and one at the end, because it is a string.

Inside this string is another quoted string, and the rule here is that every " in the original string must be replaced with "". (Otherwise it might be misread as the end of the whole outer string).
StuartR


User avatar
sobershea
2StarLounger
Posts: 184
Joined: 08 Feb 2010, 23:37
Location: Howell, Michigan USA

Re: Open Interactive Guide with VBA

Post by sobershea »

HansV wrote:FollowHyperlink can't be used to open an application and a file with it. The Shell instruction can be used for that, but it expects paths that contain spaces to be enclosed in quotes. Because the argument to Shell is already a quoted string, we can't simply use quotes within it. To use a quote " within a quoted string, we must double it to "".

To open the guide in a normal window, use

Shell """C:\Program Files (x86)\Microsoft Silverlight\sllauncher.exe"" 3614527491.office.microsoft.com", vbNormalFocus

To open it in a maximized window, use

Shell """C:\Program Files (x86)\Microsoft Silverlight\sllauncher.exe"" 3614527491.office.microsoft.com", vbMaximizedFocus
Hans, I get a Run Time Error 5 Invalid procedure call or argument with both of these.
Sherry

User avatar
HansV
Administrator
Posts: 78488
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Open Interactive Guide with VBA

Post by HansV »

That is very strange (Shell normally doesn't display error messages), but I don't have Office 2010 so I can't test. Perhaps someone who has Office 2010 can comment.
Best wishes,
Hans

MelanieB
3StarLounger
Posts: 310
Joined: 19 Apr 2010, 16:18
Location: middle of the state of Washington

Re: Open Interactive Guide with VBA

Post by MelanieB »

Did anyone figure this out yet? I'm also trying to get this to work. Thanks!!

User avatar
sobershea
2StarLounger
Posts: 184
Joined: 08 Feb 2010, 23:37
Location: Howell, Michigan USA

Re: Open Interactive Guide with VBA

Post by sobershea »

Melanie, I kind of gave up on it. Be sure to post if you figure it out.
:hairout:
Sherry