Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

superscape

macrumors 6502a
Original poster
Feb 12, 2008
937
223
East Riding of Yorkshire, UK
Hi all,

I'm struggling with something that should be super-easy. It's probably the dreaded Curse of M****soft, but just in case it's my own stupidity (not impossible) I wondered if anyone can help me out? I'm trying to export an Excel spreadsheet as HTML. I swear the following worked in an earlier version:

Code:
set theFilePath to "Macintosh HD:Users:MyUserName:Desktop:blah.html"
tell application "Microsoft Excel"
   activate
   tell active workbook
       save as active sheet filename theFilePath file format HTML file format
   end tell
end tell

...but I'm trying to get it to work on Excel (v15.15) on High Sierra and I'm getting no errors but no output either - no file created at all.

Interestingly, if I delete the "file format HTML file format" bit then it works and I get a spreadsheet saved.

Any suggestions massively appreciated.

Thanks
r.
 
Just for the record, I never did quite get this to work. In the end, I satisfied myself with having the user copy the text to the clipboard and getting an NSAttributedString from there, which was enough for my purposes.

Darn pesky Excel!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.