javaman12
03-08-2013, 12:46 PM
Hello,
I have many PPS files stored in a folder that I need converted into PPT. I've tried piecing together a macro based on what I've found online, but I can't get it to work. Here's what I've come up with so far, but it results in an Type Mismatch error:
Sub LoopDirectory()
Dim vDirectory As String
Dim oPres As Presentations
vDirectory = "C:\test\"
vFile = Dir(vDirectory & "*.*")
Do While vFile <> ""
Set oPres = Presentations.Open(FileName:=vDirectory & vFile)
ActivePresentation.SaveAs FileName:=vDirectory & vFile, FileFormat:=ppSaveAsDefault
ActivePresentation.Close
vFile = Dir
Loop
End Sub
Can anyone help with this?
I have many PPS files stored in a folder that I need converted into PPT. I've tried piecing together a macro based on what I've found online, but I can't get it to work. Here's what I've come up with so far, but it results in an Type Mismatch error:
Sub LoopDirectory()
Dim vDirectory As String
Dim oPres As Presentations
vDirectory = "C:\test\"
vFile = Dir(vDirectory & "*.*")
Do While vFile <> ""
Set oPres = Presentations.Open(FileName:=vDirectory & vFile)
ActivePresentation.SaveAs FileName:=vDirectory & vFile, FileFormat:=ppSaveAsDefault
ActivePresentation.Close
vFile = Dir
Loop
End Sub
Can anyone help with this?