• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Issues with compatibility

Artisez

Member
I added a command button to a spreadsheet to save the sheet using certain cells for the save name and to save to a specific folder. I first get a compatibility notice, when I click continue I get a recalculate popup. When I click yes I then get the run time error. At the moment nothing I do will get rid of the compatibility issues. If I remove the command button and remove the code I get no issues. Put the button and code back and the issue is back.
Code:
Private Sub CommandButton2_Click()

Dim Path As String

Dim FileName1 As String

Dim FileName2 As String

Path = "Y:\TLF\TLW Saves\"

FileName1 = Range("B52")

FileName2 = Range("B50")

ActiveWorkbook.SaveAs Filename:=Path & FileName1 & "-" & FileName2 & ".xlsm", FileFormat:=xlNormal

End Sub

Any help would be appreciated. Just trying to get rid of the compatibility issues and one click save my spreadsheet. Thanks.
 

Attachments

  • TLF Compat.JPG
    TLF Compat.JPG
    76 KB · Views: 7
  • TLF Recalc.JPG
    TLF Recalc.JPG
    36.5 KB · Views: 10
  • Runtime error 1004.JPG
    Runtime error 1004.JPG
    18.7 KB · Views: 5
@Artisez,

You might try the following line before the SaveAs:

Code:
Application.DisplayAlerts = False

You should also insert the same command but =True before the End Sub

Hope that helps.

Regards,
Ken
 
Back
Top