HTML:
Sub PasswordSave()Application.DisplayAlerts = FalseApplication.ScreenUpdating = False
SaveAsName = Application.GetSaveAsFilename( _FileFilter:="Excel Files (*.xlsx), *.xlsx")
ActiveWorkbook.SaveAs Filename:=SaveAsName, FileFormat:= _xlNormal, WriteResPassword:="test", ReadOnlyRecommended:=False _, CreateBackup:=False
End Sub
Hello, I have code above to let users choose save as path and save. However, after saving, I get an error when I open up the saved file
error message:
"The file format or file extension is no valid. Verify that the file has not been corrupted and that the file extension matches the format of the file".
However If i don't use vba and save file as xlsx extension, file works without any problem.(original file has xls extension.)
Also is there any way to set up, to display current location of the workbook when saving interface pops up?
Does anyone has good idea on this? Anything helps!
Thank you!
Last edited: