ExcelBanter

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

AD108

Validate Workbook Name
 
What would be a good method to validate the name a workbook is saved as.
For example, I want to force the user to save a template workbook with the
words "*Air Container*" included in the name. Note the wildcards, as each
file will have a seperate name, but must include the words Air Container.

Thanks in advance.

AD108



Mark Driscol[_2_]

Validate Workbook Name
 
See Rob Bovey's post here.

http://groups.google.com/group/micro...9a9 e56275300

You could modify his code a bit like this

If szFile < "False" Then
If UCase(szFile) Like UCase("*Air Container*") Then
''' Do your processing here.
Else
MsgBox "Bad Filename!", vbCritical, "Error"
End If
End If

to check if the file name is like "*Air Container*".

Mark


AD108 wrote:
What would be a good method to validate the name a workbook is saved as.
For example, I want to force the user to save a template workbook with the
words "*Air Container*" included in the name. Note the wildcards, as each
file will have a seperate name, but must include the words Air Container.

Thanks in advance.

AD108




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

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