1Jan

Set Fso Createobjectscripting.filesystemobject Alternative

Set fso = CreateObject('Scripting.FileSystemObject') Set f1 = fso.GetFolder('.' ) ' Returns the current directory Set f2 = fso.GetFolder('.backup') ' Returns the 'backup' directory under the current directory As a simplified example, is there a method to call on fso so that the fso.GetFolder('.' ) call returns the backup directory instead? Note Some functionality in the FileSystemObject object model is redundant. For example, you can copy a file using either the CopyFile method of the FileSystemObject object, or you can use the Copy method of the File object. The methods work the.

The answers to seem to indicate that using Scripting.FileSystemObject in Excel 2010 for the mac is not possible.What other alternative is available so I can:. get a collection of all Excel files in a specific directory. iterate through each worksheet within each file and export it to a.csv fileCurrently this is a six-step process for each file: -how to create CSV files for all worksheets in a file:1. Click 'Developer'3.

Click editor4. Click ThisWorkbook5. Copy in:Sub saveallcsvOn Error Resume NextDim ExcelFileName As StringExcelFileName = ThisWorkbook.NameFor Each objWorksheet In ThisWorkbook.WorksheetsFilename = 'FILE-' & ExcelFileName & '-WORKSHEET-' & objWorksheet.Name & '.csv'objWorksheet.SaveAs Filename:='Macintosh HD:Users:edward:Documents:temporaryNoBackup:' & Filename, FileFormat:=xlCSV, CreateBackup:=FalseNextApplication.DisplayAlerts = FalseApplication.QuitEnd Sub6. Click run (it closes by itself)I'm looking for a way to automate this on the Mac, ideally, a (cron job?, service?) would open the excel file every 10 minutes, which would in turn look in a directory, convert all the other Excel files to.csv files, and then close by itself.Without Scripting.FileSystemObject, how can I make this Excel-to-CSV conversion fully automatic on the Mac? The only way I can think of is using the 'Dir' function. Since mac supports extra characters in their filenames, wildcards do not work with the 'Dir' function.

Here is a sample. Function GetFileList(folderPath As String) As Collection'mac vba does not support wildcards in DIR functionDim file As StringDim returnCollection As New CollectionIf Right$(folderPath, 1) '/' ThenfolderPath = folderPath & '/'End Iffile = Dir$(folderPath) 'setup initial fileDo While Len(file)returnCollection.Add folderPath & filefile = Dir$LoopSet GetFileList = returnCollectionEnd Function. Grand admiral thrawn rebels.