+ Reply to Thread
Results 1 to 5 of 5

Getting this code to work on MAC (ERROR 68) - works fine on Windows

  1. #1
    Registered User
    Join Date
    07-27-2012
    Location
    Central Europe
    MS-Off Ver
    Office 365 - Mac
    Posts
    23

    Getting this code to work on MAC (ERROR 68) - works fine on Windows

    Hello all,
    with the most kind help of Kyle123, I was able to achieve my target of
    1) automatically creating a folder structure based on entry in Column 3; and
    2) automatically creating a hyperlink in the appropriate column

    The code can be found below
    Please Login or Register  to view this content.
    I have been trying to get this to work on Mac but I always get and error 68 and then debugger opens on line
    If Len(Dir(tr)) = 0 Then


    I have tried changing the \ within inverted commas in the line below
    tr = ThisWorkbook.Path & "\" & .Offset(, -2).Value
    to
    a) using :
    b) using \
    c) using " " (basically empty space)
    d) I tried changing "(denominator)" to application.pathseparator - still nothing.

    Absolutely nothing.
    I tried changing "(denominator)" to application.pathseparator - still nothing.

    Kyle123 has kindly suggested this webpage http://www.rondebruin.nl/mac.htm#Directory
    (see section Make a director when it does not exist) which might indeed work - the problem I see with that is that it does not seem to check if a folder already exists and also I am not quite clear on how I would create the sub-folders.

    But for some (stubborn/silly?) reason, I am convinced that this must work somehow and I am over-complicating life.

    Any thoughts?

    Loukas

  2. #2
    Registered User
    Join Date
    07-27-2012
    Location
    Central Europe
    MS-Off Ver
    Office 365 - Mac
    Posts
    23

    Re: Getting this code to work on MAC (ERROR 68) - works fine on Windows

    An update:
    I actually got this to work by doing the following
    1) removed the line If Len(Dir(tr)) = 0
    2) then got a series of error 76 messages - looks like it had to do with the length of the path/ solved that too
    3) also had to change the line .Hyperlinks.Add .Offset(, 4), tr, TextToDisplay:="Name" to .Hyperlinks.Add .Offset(, 4), tr

    So in a nutshell, I have found a work-around. But any ideas from anyone as to why this worked?
    Tbh, the If Len(Dir(tr)) = 0 is quite useful so would be happy to have this as a feature. Point 3 is less critical but Nice to Have.

    Any opinions would be great.
    Luke

  3. #3
    Registered User
    Join Date
    07-27-2012
    Location
    Central Europe
    MS-Off Ver
    Office 365 - Mac
    Posts
    23

    Re: Getting this code to work on MAC (ERROR 68) - works fine on Windows

    any ideas from anybody?

  4. #4
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,523

    Re: Getting this code to work on MAC (ERROR 68) - works fine on Windows

    Try replace all "\" with Application.PathSeparator

    i.e
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    07-27-2012
    Location
    Central Europe
    MS-Off Ver
    Office 365 - Mac
    Posts
    23

    Re: Getting this code to work on MAC (ERROR 68) - works fine on Windows

    Quote Originally Posted by jindon View Post
    Try replace all "\" with Application.PathSeparator

    i.e
    Please Login or Register  to view this content.
    Jindon, thanks for the suggestion. Unfortunately, it did not work.
    Still getting stuck on the same line

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1