+ Reply to Thread
Results 1 to 9 of 9

Converting VBA to mac (runtime error 429)

  1. #1
    Registered User
    Join Date
    07-23-2015
    Location
    Nederland
    MS-Off Ver
    mac 2004
    Posts
    6

    Converting VBA to mac (runtime error 429)

    Hi all!
    I'm a beginner in coding. But I managed to make a working code for windows, but when I want to convert it to Mac it gave a runtime error 429 (AvtiveX component can't create object). This is the code that gave the error:

    Please Login or Register  to view this content.
    The error is in the "With CreateObject("Scripting.FileSystemObject")" part. Already from google search I found out that Scripting.FileSystemObject is only supported by windows, and will never work on a Mac. But I don't know how to fix it. Hope you can help me!

    Kind regards

  2. #2
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,239

    Re: Converting VBA to mac (runtime error 429)

    You can't use windows libraries on a mac (pretty much anything that requires you to set a reference or use CreateObject).

    I think Dir should work though, so you can use that to check if something exists - also mkDir for creating folders

  3. #3
    Registered User
    Join Date
    07-23-2015
    Location
    Nederland
    MS-Off Ver
    mac 2004
    Posts
    6

    Re: Converting VBA to mac (runtime error 429)

    But do I only change the part of CreateObject("Scripting.FileSystemObject") with the Dir function? Or should I adjust the whole thing?
    I already read about the Dir function, but didn't know how to implement it....

  4. #4
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,239

    Re: Converting VBA to mac (runtime error 429)

    I think this should be cross platform, but it's untested:
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    07-23-2015
    Location
    Nederland
    MS-Off Ver
    mac 2004
    Posts
    6

    Re: Converting VBA to mac (runtime error 429)

    Thanks for helping me out!
    In the line of If not Len(Dir(stpath...) the error 68 occurs (device unavailable).

    Is it needed to define vbDirectory?
    Last edited by Liset; 07-23-2015 at 06:49 AM.

  6. #6
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,239

    Re: Converting VBA to mac (runtime error 429)

    Does Dir with the file path work? Remember that macs don't use the same path separators as windows

  7. #7
    Registered User
    Join Date
    07-23-2015
    Location
    Nederland
    MS-Off Ver
    mac 2004
    Posts
    6

    Re: Converting VBA to mac (runtime error 429)

    If I put it this way it still can't find its path
    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    07-23-2015
    Location
    Nederland
    MS-Off Ver
    mac 2004
    Posts
    6

    Re: Converting VBA to mac (runtime error 429)

    Please Login or Register  to view this content.
    This still gives the error of unavailable device... Good thing, it can find its path! Is something like MacID a solution?
    Last edited by Liset; 07-23-2015 at 11:53 AM.

  9. #9
    Registered User
    Join Date
    07-23-2015
    Location
    Nederland
    MS-Off Ver
    mac 2004
    Posts
    6

    Re: Converting VBA to mac (runtime error 429)

    Still a little bit desperate on the problem over here. I think that it may be caused by an empty folder, but how can I avoid this error then? Hope you can help me out!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Runtime error '1004': Paste special method of range class error.
    By Daryl Zer0 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 11-05-2014, 01:44 AM
  2. [SOLVED] VBA Error: Runtime Error 1004: AutoFilter method of Range class failed
    By jl22stac in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-03-2013, 07:27 PM
  3. [SOLVED] Range error in code, runs alone but not inside my full program, giving runtime error 1004
    By charizzardd in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-23-2012, 03:34 PM
  4. Defining Array - Runtime error 9, Subscript out of range error
    By MaartenW in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-03-2012, 07:32 AM
  5. runtime error 3265 error in a VBA Query to pull info from ERP Database
    By NBVC in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 05-12-2010, 03:59 PM
  6. Excel xmlHTTP object error message - system/runtime error
    By Porky2007 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-23-2007, 09:36 AM
  7. Excel 2003 Macro Error - Runtime error 1004
    By Cow in forum Excel General
    Replies: 2
    Last Post: 06-07-2005, 09:05 AM

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