View Single Post
  #22   Report Post  
Posted to microsoft.public.excel.programming
Robert Baer Robert Baer is offline
external usenet poster
 
Posts: 93
Default File Path Issue in Excel 2016 for Mac

Peter T wrote:
"Robert Baer" wrote in message
colglbo wrote:
I have been using visual basic in Excel 2011 for Mac to open a file
and perform some operations on that file. The code to open the file is

Workbooks.Open Filename:= "Mac Backup:Data Files:Excel Files:Test
File.xlsx"

Mac Backup is the name of a removable drive.

The code has worked fine until I upgraded to Excel 2016 for Mac. Now
when I run the code I get the message "Sorry, we couldn't find Mac
Backup:Data Files:Excel Files:Test File.xlsx."

I have changed the colon to back slash and forward slash and still get
the error message. This same code works fine in Excel 2016 for PC
using the back slash. Apparently something has changed in the file
path structure in the Excel 2016 version for Mac. Any help would be
appreciated.

Typical M$ garbage - remove useful functionality and say nothing.


Seems it was Apple that changed things -

https://macadmins.software/docs/UserContentIn2016.pdf

https://www.rondebruin.nl/mac/mac034.htm

There's a mountain of related links.

They totally diddled file open/write as follows:
ActivePrinter = "Acrobat PDFWriter on FILE:"
' Above sets printer in Excel 2003; will crash in Excel 2010.
' In "modern" defective Excel apps, following prints to default as a
' file AND prompts file name; file in printer format, NOT in PDF format.
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Preview:=False, _
ActivePrinter:="Acrobat PDFWriter on FILE:", PrintToFile:=True, _
Collate:=False, PrToFilename:=pPath + vNam
Kill pPath + vNam 'only PDF left


There could be several reasons. Here and when you posted your problem you
didn't give
any context. You were offered a possible solution but unless I miised it you
didn't reply.

Peter T



So far, the ONLY solution that actually worked, was the one i posted,
and only in Excel 2003.
Certainly NOT in Excel 2010 that was purported to "do everything".