I need to be able to have a prompt to select the file folder containing excel files, then have the vba open each file and save them in a new folder. Below is the code that is not currently working:
Code:
Private Sub Command35_Click()
Dim strFile As String
Dim strPath As String
Dim strBrowseMsg As String
strBrowseMsg = "Select the folder that contains the EXCEL files:"
strPath = BrowseFolder(strBrowseMsg)
sFile = Dir(strPath & "*")
Do While strFile <> ""
Workbooks.Open (strPath & strFile)
result = ActiveWorkbook.Name
ActiveWorkbook.SaveAs _
FileName:="C:\Users\tdri004\Desktop\KeHe\KPOF\Loaded KPOFs into Database\" + result, _
FileFormat:=51
ActiveWorkbook.Close True
strFile = Dir()
Loop
End Sub
Comment