'Batch conversion of pps/ppt to pptx

So I am not a scripter, just a guy who has been trying to figure out how to batch convert old powepoint ppt and pps files to the pptx. I found a macro which seems to be very close to doing the job, problem is when It opens in ppt it opens in read only mode, and errors out. The preferred way to convert is to open the ppt select convert and then save. Need to do a bunch of files in the same folder. can anybody help

 Sub BatchSave()
' Opens each PPT in the target folder and saves as PowerPoint 2007/2010 (.pptx) format

Dim sFolder As String
Dim sPresentationName As String
Dim oPresentation As Presentation

' Select the folder:

Set fDialog = Application.FileDialog(msoFileDialogFolderPicker)
With fDialog
.Title = "Select folder and click OK"
.AllowMultiSelect = False
.InitialView = msoFileDialogViewList
If .Show <> -1 Then
    MsgBox "Cancelled By User", , "List Folder Contents"
    Exit Sub
End If
sFolder = fDialog.SelectedItems.Item(1)
If Right(sFolder, 1) <> "\" Then sFolder = sFolder + "\"
End With

' Make sure the folder name has a trailing backslash
If Right$(sFolder, 1) <> "\" Then
    sFolder = sFolder & "\"
End If

' Are there PPT files there?
If Len(Dir$(sFolder & "*.PPT")) = 0 Then
    MsgBox "Bad folder name or no PPT files in folder."
    Exit Sub
End If

' Open and save the presentations
sPresentationName = Dir$(sFolder & "*.PPT")
While sPresentationName <> ""
    Set oPresentation = Presentations.Open(sFolder & sPresentationName, , , False)
    Call oPresentation.SaveAs(sFolder & sPresentationName & "x")
    oPresentation.Close
Wend

MsgBox "DONE"

End Sub


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source