ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Validate WorkBook name (https://www.excelbanter.com/excel-programming/365602-validate-workbook-name.html)

AD108

Validate WorkBook name
 
I want to use the "Before Save" event to force users to save a template with
a certain naming convention. (The name must contain the words Air
Container)

Is this possible. For example in the Before Save event procedure it may say
something like

If WorkBook.Name < "*Air Container*" (if true then it would prevent the
save from completing.)

Thanks in advance
AD108



Stefi

Validate WorkBook name
 
Bob Philips gave me an excellent solution to a similar problem. See thread
"SaveAs with a pre-defined filename" in this group!

Regards,
Stefi


€žAD108€ ezt Ã*rta:

I want to use the "Before Save" event to force users to save a template with
a certain naming convention. (The name must contain the words Air
Container)

Is this possible. For example in the Before Save event procedure it may say
something like

If WorkBook.Name < "*Air Container*" (if true then it would prevent the
save from completing.)

Thanks in advance
AD108




Piotr Lipski

Validate WorkBook name
 
On Tue, 27 Jun 2006 20:08:17 -1000, AD108 wrote:

I want to use the "Before Save" event to force users to save a template with
a certain naming convention. (The name must contain the words Air
Container)


Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
If Not (ThisWorkbook.Name Like "*Air Container*") Then Cancel = True
End Sub

--
PL

AD108

Validate WorkBook name
 
Thanks alot


"Piotr Lipski" wrote in
message ...
On Tue, 27 Jun 2006 20:08:17 -1000, AD108 wrote:

I want to use the "Before Save" event to force users to save a template

with
a certain naming convention. (The name must contain the words Air
Container)


Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
If Not (ThisWorkbook.Name Like "*Air Container*") Then Cancel = True
End Sub

--
PL





All times are GMT +1. The time now is 10:35 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com