Solved

Launching an application from Excel 2011 on Mac using Shell command

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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

In this article, I will show you HOW TO: Suppress Configuration Issues and Warnings Alert displayed in Summary status for ESXi 6.5 after enabling SSH or ESXi Shell.
Use of TCL script on Cisco devices:  - create file and merge it with running configuration to apply configuration changes
Viewers will learn what comprises a theme in Excel 2013, as well as how to customize them.
Video by: Zack
Viewers will learn about using Excel in a browser with Excel Online.

757 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

21 Experts available now in Live!

Get 1:1 Help Now