Solved

Launching an application from Excel 2011 on Mac using Shell command

Posted on 2014-04-17
2
55 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

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 what comprises a theme in Excel 2013, as well as how to customize them.
Viewers will learn how to create a PivotTable and make basic changes to it in Excel 2013.

863 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

Need Help in Real-Time?

Connect with top rated Experts

28 Experts available now in Live!

Get 1:1 Help Now