Join Curt Frye for an in-depth discussion in this video, Using relative and absolute cell references, part of Excel for Mac 2016 Essential Training.

Microsoft excel 2007 for mac. Whenever I try to make a chart from data in excel, it returns ' The program has enountered an error and will shut itself down down' and then it does.

For the first time since I switched to Microsoft Excel for Mac 2011, I came across the need to process a number of workbooks all located in the same folder. Having done this many times in a Windows environment I wasn’t expecting much difficulty.

But as usual, there were a few subtle differences in the way the VBA macro needed to be written for the Mac. My first issue came with accessing files and folders for the Mac file system. Review vpn for mac and android. In the Windows world I would do something like this: strPath = “C: Data excel ” I realized that wasn’t going to work. After some research I found that the way to reference the Mac filesystem in VBA is like this: strPath = “Macintosh HD:Users:username:Documents:TestExcel:” Once I found that I thought I’d be sailing along. But then I ran into my next hurdle.

Excel for Mac 2011 doesn’t handle wildcards in VBA. Previously I would handle getting filenames like this: strFileName = dir(“c: data excel *.xls”) In the Mac VBA world it needs to be handled like this: strFileName = Dir(“”) Once I had those speed bumps out of the way it was clear sailing. Below is an example of the finished code used to process all the XLSX files in a directory. Sub process_directory_of_workbooks() Application.ScreenUpdating = False Dim wbOpen As Workbook Const strPath As String = 'Macintosh HD:Users:username:Documents:TestExcel:' Dim strFileName As String ChDir strPath 'Get FileName strFileName = Dir(') Do While strFileName ' Set wbOpen = Workbooks.Open(strPath & strFileName) varName = varName & vbCrLf & ActiveWorkbook.Name 'Process Workbooks in any way needed wbOpen.Close 0 'Get next file in folder strFileName = Dir Loop MsgBox varName & vbCrLf & 'Done' End Sub.