#1
|
|||
|
|||
Word 2019 for Mac's VB Doesn't Recognize Paths
I was forced to upgrade to Mac OS X High Sierra which forced me to switch from MSO 2011 to MSO 2019 for compatibility. Now all my macros that have file paths in them generate an error (see attachment) for following example:
Code:
Documents.Open FileName:="Macintosh HD:Users:DariusMacPro:Documents:Word:Forms:Labels:Labels.doc" Code:
chdir "Macintosh HD:Users:DariusMacPro:Documents:Word:Forms:Labels" Documents.Open FileName:="Labels.doc" |
#2
|
||||
|
||||
I don't see any immediate reason for the code to fail so I will just make some observations of things to look at.
The error message looks like the path is being truncated for some reason. Can you explore the length of the string to see if it is getting shortened? Why is there a space in front of the filename in the first line? Why are you using doc format with Office 2019?
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
#3
|
|||
|
|||
Hi Andrew,
Good observations! (1) I have no idea why the path is being truncated. MS is having a nightmare in this version! I tried the following to no avail: Code:
Dim str As String * 128 str = "Macintosh HD:Users:DariusMacPro:Documents:Word:Forms:Labels:Labels.doc" Documents.Open FileName:=str (3) My file is .doc type because I have many macros inside it. Finally, I have 60 days free technical support with MS. But they said the TS doesn't cover VB. They wanted to charge me to fix a problem that they caused. This isn't the only thing that doesn't work. AutoExec() under Normal doesn't work either! I'll continue to look into the truncation. That is obviously the culprit! Darius (VBorNotVB) |
#4
|
|||
|
|||
I found the answer to my own question. The answer is twofold:
(1) In Office 2011 for Mac (at least in my installation), MS VBA used Document.Name as full path (including file name) - In Office 2019 for Mac they have rectified this mistake. Document.Path holds the document path and document.name holds the name. Document.FullName holds the path plus the name. (2) In Office 2019, MS has also changed the delimiter between folders in path from ":" to "/". Microsoft wanted to charge me $400 to give me the above answer which would have taken 10 seconds. Cheap company. I'm very glad I switch to Mac/OS! |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Word 2013 Does Not Recognize Misspelled Words | sd1233 | Word | 7 | 07-29-2017 07:21 PM |
Remove image paths from Word to PDF convertion | gwk1975 | Word | 0 | 07-30-2014 05:02 AM |
Word does not recognize carets | stegngas | Word | 1 | 12-07-2012 08:30 PM |
Changed data base name. Outlook doesn't recognize. | Skip | Outlook | 1 | 10-20-2011 10:55 AM |
Word crashed and now doesn't recognize file as a Word doc? | sara | Word | 0 | 09-15-2010 02:12 PM |