Open a Specific Excel Workbook and Sheet

Attached macro is trying to open a specific sheet (Sheet1) in Excel. But I just get a 'Macro cancelled' message as file path non-existent. Is there a way to open a specific sheet?

Hey Ross,

You didn't get the macro uploaded.

How to Post Your Macro to the Forum

What version of macOS?

What version of Excel?

-Chris

Hopefully that screenshot uploaded now.

Hey Ross,

Yes, it did. Thank you.

Okay – this can't possibly work, because we're dealing with a file path to an Excel document, and the file system doesn't know anything at all about Excel worksheets.

You're using an Open a File Folder or Application action, and this doesn't accept HyperLinks – only file paths.

So, what's the answer?

If you just want to open a given Excel workbook to the desired sheet then AppleScript can do the job.

-Chris


Open Microsoft Excel Worksheet to a Given Sheet v1.00.kmmacros (9.5 KB)

2 Likes

That's brilliant thanks

1 Like

Thanks ccstone!
Exactly what I needed!!!
Happy Thanksgiving!

1 Like

I know I'm late to the party but how would I need to change the code to make the macro a subroutine in which I can enter the file path of the xlsx and the sheet name as 2 variables?

thanks a lot!