Share via

Excel - Editing File path in Visual Basic

Anonymous
2012-09-25T02:02:39+00:00

I have a spreadsheet from the PC version of Excel that works with an outdated Windows-only accounting system.  It has a macro that looks for a specific csv file in a location C:\OSFS.  The csv file is the download from the antique accounting system that I'm running in Parallels Desktop 8. The accounting software drops the csv file into C:\OSFS, opens the Excel spreadsheet with macro in the same location using Excel:Mac, but when I execute the macro and it attempts to import the csv file, it cannot find it because the path is "C:\OSFS\FOFS.csv", which doesn't work with the Mac OS X operating system.

I need to edit the macro to provide the correct path to the csv file.  I'm having a bit of a time trying to figure out what that path is, so any help would be appreciated.  I opened the file location in Finder and found this for a "location description": file://localhost/Volumes/C//OSFS/FOFS.csv

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Anonymous
2012-09-25T16:18:17+00:00

Here's the solution: file://localhost/Volumes/C//OSFS/FOFS.csv is referenced as "Macintosh HD:Volumes:C:OSFS:FOFS.csv" in VBA.

Was this answer helpful?

0 comments No comments

Answer accepted by question author

Anonymous
2012-09-25T10:54:41+00:00

It's been a while since I've used parallels, but I think you can share nearly any folder you wish between the virtual machine and Mac OS X. You can then use the OS X reference as your file path.

You may want to look at Ron deBruin's excellent examples of referencing paths in MacOffice VBA, too.

Was this answer helpful?

0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Anonymous
    2012-09-25T12:57:20+00:00

    Thanks for the references!  I have the sharing set up, so I'll read Ron's articles to learn how to set the path properly in VBA.

    Was this answer helpful?

    0 comments No comments