I would like to go up one level to process the following loop. I thought I could use ChDir but I see that when I call the files in, I would be in the incorrect directory. Any help would be appreciated.
I would like to generalize the path because the directory is always changing and is different for other users.
Though, here is a reference of how I would like the code to work.. The files I am processing would be in Data1 and this VBA module would be in Processing, see below. So I would need to go up one directory, to Data1, to pull the files, convert them, and then save the converted files in the same directory, Data1.
C:\Users\Documents\CDRL\Data1\Processing
Sub loopFiles()
Dim fso As New FileSystemObject
Dim fil As File
Dim fold As Folder
Dim yourfolder As String
Set fold = fso.GetFolder(Application.ActivePresentation.Path)
ChDir ".."
For Each fil In fold.Files
If InStr(1, fil.Name, ".potx") > 0 Then
Application.Presentations.Open fil.Path
ActivePresentation.SaveAs Replace(fil.Path, ".potx", ".pptx"), ppSaveAsDefault
ActivePresentation.Close
fil.Delete True
End If
Next fil
End Sub