Hi Experts, :)
Wanted to use the "Save As" feature to create a copy of a workbook in a different location.
I have a Master workbook which will contain over 20 sheets... Of these sheets the end user would need to view only 2 .. I was figuring creating a copy in a different location would be the easiest way to remove the other sheets the end user do not need.
I've attached a sample workbook with the following code in module: modCopyWB
Dim sFileName As String, SFilePath As String
sFileName = ThisWorkbook.Name
SFilePath = "C:\Temp\"
Application.ScreenUpdating = False
On Error GoTo errcather
Sheets(Array("RPV", "RPV (2)")).Copy
On Error GoTo 0
ActiveWorkbook.SaveAs Filename:=SFilePath & sFileName
MsgBox "One or more the worksheets does not exist in this workbook"
Application.ScreenUpdating = True
The problem I'm having is when it's time to save the workbook it states that I can't save it due to my workbook containing Macros. It's advising me that I can't save the VB project as a non-macro workbook. But the name I'm asking it to be named in the code is the same as my current 'macro' enabled workbook with the ".xlsm" extension.
Why doesn't the code recognize or accept the naming convention? Is there a fix?
The "save as" workbook should have the same name as the Master workbook just at a different location where the end users will have READ ONLY access.
Thank you in Advance!