Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-31-2018, 09:30 AM
VBorNotVB VBorNotVB is offline Word 2019 for Mac's VB Doesn't Recognize Paths Mac OS X Word 2019 for Mac's VB Doesn't Recognize Paths Office 2016 for Mac
Novice
Word 2019 for Mac's VB Doesn't Recognize Paths
 
Join Date: Oct 2018
Location: Southern California
Posts: 25
VBorNotVB is on a distinguished road
Default 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"
Rewriting above example works intermittently.


Code:
chdir "Macintosh HD:Users:DariusMacPro:Documents:Word:Forms:Labels"
Documents.Open FileName:="Labels.doc"
All help is appreciated!
Attached Images
File Type: png Screen Shot 2018-10-31 at 9.27.45 AM.png (22.0 KB, 17 views)
Reply With Quote
  #2  
Old 10-31-2018, 02:06 PM
Guessed's Avatar
Guessed Guessed is offline Word 2019 for Mac's VB Doesn't Recognize Paths Windows 10 Word 2019 for Mac's VB Doesn't Recognize Paths Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,932
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

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
Reply With Quote
  #3  
Old 10-31-2018, 02:22 PM
VBorNotVB VBorNotVB is offline Word 2019 for Mac's VB Doesn't Recognize Paths Mac OS X Word 2019 for Mac's VB Doesn't Recognize Paths Office 2016 for Mac
Novice
Word 2019 for Mac's VB Doesn't Recognize Paths
 
Join Date: Oct 2018
Location: Southern California
Posts: 25
VBorNotVB is on a distinguished road
Default

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
(2) The space before the filename was a typo

(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)
Reply With Quote
  #4  
Old 11-18-2018, 01:32 PM
VBorNotVB VBorNotVB is offline Word 2019 for Mac's VB Doesn't Recognize Paths Mac OS X Word 2019 for Mac's VB Doesn't Recognize Paths Office 2016 for Mac
Novice
Word 2019 for Mac's VB Doesn't Recognize Paths
 
Join Date: Oct 2018
Location: Southern California
Posts: 25
VBorNotVB is on a distinguished road
Default

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!
Reply With Quote
Reply

Thread Tools
Display Modes


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 2019 for Mac's VB Doesn't Recognize Paths Word does not recognize carets stegngas Word 1 12-07-2012 08:30 PM
Word 2019 for Mac's VB Doesn't Recognize Paths 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

Other Forums: Access Forums

All times are GMT -7. The time now is 12:28 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft