+ Reply to Thread
Results 1 to 5 of 5

Saving a BAS file to a Mac "C" drive

  1. #1
    Registered User
    Join Date
    05-04-2015
    Location
    Chicago, Illinois
    MS-Off Ver
    2007
    Posts
    20

    Saving a BAS file to a Mac "C" drive

    Hey, I just wanted to know how the file structure in Mac worked for saving a module file to the C drive.

    I currently do the following in Windows:

    On Error Resume Next
    Kill ("C:\RBIWMod4.bas")
    On Error GoTo 0
    ActiveWorkbook.VBProject.VBComponents("Module1").Export ("C:\RBIWMod4.bas")

    --Code would go here--

    Application.VBE.ActiveVBProject.VBComponents.Import ("C:\RBIWMod4.bas")
    Kill ("/RBIWMod4.bas")

    I assume for Mac it would be something like this:

    If Val(Application.Version) > 14 Then


    On Error Resume Next
    Kill ("/RBIWMod4.bas")
    On Error GoTo 0
    ActiveWorkbook.VBProject.VBComponents("Module1").Export ("/RBIWMod4.bas")

    --Code would go here--

    Application.VBE.ActiveVBProject.VBComponents.Import ("/RBIWMod4.bas")
    Kill ("/RBIWMod4.bas")


    Not entirely positive. I have a Mac user who's getting an error when attempting to run the macro.

    Thanks!

  2. #2
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Saving a BAS file to a Mac "C" drive

    Why not use the same folder as the workbook? Then you can use Activeworkbook.Path & Application.PathSeparator
    Remember what the dormouse said
    Feed your head

  3. #3
    Registered User
    Join Date
    05-04-2015
    Location
    Chicago, Illinois
    MS-Off Ver
    2007
    Posts
    20

    Re: Saving a BAS file to a Mac "C" drive

    Well cause I open a new series of new workbooks that aren't saved (so activeworkbookpath is different from where I have the file that creates them) so I just add it the C drive and then delete for easy access.

  4. #4
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Saving a BAS file to a Mac "C" drive

    You could use ThisWorkbook.path instead then. Macs don't have C drives and the disk names can differ.

  5. #5
    Registered User
    Join Date
    05-04-2015
    Location
    Chicago, Illinois
    MS-Off Ver
    2007
    Posts
    20

    Re: Saving a BAS file to a Mac "C" drive

    Okay that's perfect thanks.

+ 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. [SOLVED] How to enable user to click "cancel" if file name exists when saving as...
    By TBO in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-31-2014, 02:22 PM
  2. Replies: 1
    Last Post: 05-23-2013, 02:04 PM
  3. [SOLVED] Stop Users Saving Macro Enabled File as ".xlsx"
    By OzTrekker in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-17-2012, 11:33 PM
  4. VBA Help needed for saving workbook specific folder and file extension ".xlsm"
    By krjoshi in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-13-2012, 07:50 AM
  5. Replies: 0
    Last Post: 11-16-2011, 01:35 PM
  6. Replies: 4
    Last Post: 07-15-2011, 11:50 AM
  7. Transfert cell values from file "A" to file "B" skipping columns in file "B".
    By Sentrosi in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-16-2009, 11:11 PM
  8. Saving a file to a "YYYY" and "MMM" folder
    By hriggs in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 01-10-2008, 07:00 AM

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