mardi 24 avril 2018

Count Workbooks in VBA and close Excel if Count > 1

Alright, so I am 100% new to VBA. I started yesterday and I need to figure out how to close a specific Excel file if someone opens a new Workbook for Excel.

This is what I have:

If Workbooks.count > 1 Then Application.Visible = False End If

I saved it and then close it and then open the file back up then hit crtl+n for a new instance of Excel and nothing happens. Am I missing initial code for it to active the count function?

Aucun commentaire:

Enregistrer un commentaire