?
Solved

Launching an application from Excel 2011 on Mac using Shell command

Posted on 2014-04-17
2
Medium Priority
?
106 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
Video by: Zack
Viewers will learn about using Excel in a browser with Excel Online.
Viewers will learn the basics of using filtering and sorting in Excel 2013.

770 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