How can I do this on a MAC?
![]()
Please Login or Register to view this content.
How can I do this on a MAC?
![]()
Please Login or Register to view this content.
No idea as here it's the Excel for Windows section !
Why function? You are not returning any value/object. Just use Sub.
At any rate, you can use MacScript to open URL in Chrome.
Check the code in link.
http://www.officeonemac.com/vba/open_url.html
"Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something."
― Robert A. Heinlein
CK76 - When I try to run the code, on step "MacScript S", I receive:
Run-time error "5": Invalid procedure call or argument
Any ideas on why this would be?
Ah, looks like MacScript is deprecated (last working version was Excel 2011 for Mac looks like), due to restrictions in sandbox.
See link for more detail on the subject (see section for Excel 2016 for Mac).
http://www.rondebruin.nl/mac/applescripttask.htm
I currently don't have Mac to test on, but Ron's method should work.
Thanks very much for responding. I took a look at the link - Ugh - I can't believe how much is involved. I'm not a MAC guy and was trying this to make my macros work on a mac for a co-worker, but it seems a little involved for me. I wish there was an easier way (or that I was more familiar with a MAC).
Can't you just use ThisWorkbook.FollowHyperlink ? Why does it have to be chrome?
That's an interesting idea. In my original post above I'm showing the URL as yahoo.com. But in reality, it's actually a URL that downloads a file. Internet Explore doesn't actually download the file until you hit save, but Chrome will download it to your Download directory. I then run a macro that opens the latest file in the Download directory and I can manipulate that file then. It seems using the FollowHyperlink doesn't download the file when you send it the URL.
So to re-cap, what I'm able to do in Windows is send a URL to Chrome that downloads a file, then open that file from the download directory. I want to be able to do that same functionality on a MAC.
Thanks!
FollowHyperlink can be used, if you set Chrome as default browser. It will automatically use default browser to navigate to URL (or download file from URL).
But do note, you will have security warning dialog that will pop-up. It cannot be turned off using Application.DisplayAlert method, and will require one or more of following.
1. Trusted Location/site setting
2. Find and edit the registry key associate
However, I'm not that familiar with Mac, so not sure if this works for Mac as well.
Hmm, it's not working for me - even on Windows. Yes, I can send a URL and it will navigate to a URL, but if the link is to download a file, it does not do that.
Have you tried this: https://stackoverflow.com/questions/...el-vba-for-mac
You may need to tweak it a bit for saving the file though
Well, I worked on it again today with a MAC, and the Followhyperlink worked!! Mac sometimes causes issues because of permissions, but it looks like it works great! Thanks you guys!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks