Solved

Launching an application from Excel 2011 on Mac using Shell command

Posted on 2014-04-17
2
65 Views
Last Modified: 2016-06-05
I'm trying to work out how to launch an application on a mac from Excel 2011.  On Windows 7 using the shell command in Excel 2010 does the job perfectly. The only response I get on the mac is that the path can't be found.
I have a simple application called GetPath that lives on the desktop. I use the following code:

Shell "Macintosh HD:Users:MyName:Desktop:GetPath"

Is it a possibility that for some reason the hard drive has another name? and if so, how can I find out?
Any help would be greatly appreciated.
0
Comment
Question by:pvman
2 Comments
 

Accepted Solution

by:
pvman earned 0 total points
ID: 40008890
The only thing I need to achieve is to launch the GetPath application that resides on the desktop. I have created a macro enabled Excel 2011 workbook that also resides on the desktop.
I have created the following macro in this workbook:

Sub startGetPath()
  Dim s As String
 
  s = ThisWorkbook.Path
  MsgBox s
  s = s & ":GetPath"
  Shell (s)
End Sub

The message displayed is:  Macintosh HD:Users:pvman:Desktop
(pvman being my user name)
This by the way settles the issue about the name of the hard disk that I mentioned in my earlier post.
My simple minded assumption was that adding :GetPath to ThisWorkbook.Path would get me to the GetPath application, only to be told that there is a runtime error 53 and that the file can't be found. I can categorically state that a file with that name exists on the desktop and I can run it from there by double clicking on it.
From searches on the internet I found out that the Excel 2011 Shell function
- requires the full path
- requires the colon as path separator
- does not tolerate additional parameters, unlike the Windows version
Having met these conditions as far as I can make out, I am at a loss as to why the Shell function doesn't work as expected or are there more dark secrets lurking beneath the surface.
I am very familiar with the Windows environment but not at all with Apple script and that is why I am focussing on using the Shell function, if at all possible.
I would be very grateful if there is anyone who can shed light on this issue.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Restrict Pivot Table Field List from Showing 6 233
Excel Formula Needed 2 56
VBA asking for a password 12 42
Excel Score Formula 5 65
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
: Microsoft Office Collaborate for free and online versions of Microsoft  Word, Excel, Powerpoint, OneNote, Onedrive , Email, Calendar etc. In short we can say that Microsoft office is a suite of servers, applications and services developed by  Micr…
Viewers will learn the different options available in the Backstage view in Excel 2013.
Viewers will learn how to customize the ribbon and quick access toolbar in Excel 2013.

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question