LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 247
Default Search for active file name (modified), then....

When a file has been E-Mailed with my code, it is saved as
C:\Contracts EMailed\'Current file name' + _EM.
IF one tries to resave the original file, this code is to check
if it has been saved before.
If YES, then, exit, if NO, continue.

Sub CheckFileName()
' Check if the following exists:
' C:\Contracts EMailed\'filename'_EM.xls
' IF it exists, then Process is not allowed
' NotAllowed Message pops up, Click OK, and project Exits
' If it does NOT exist, then Continue

Dim FName As String
FName = ActiveWorkbook.Name
Dim NewName As String
NewName = FName + "_EM"

' The following line comes up with Compile Error - Syntax error

If "C:\Contracts EMailed\NewName.Exists = True Then

Call NotAllowed

Else: Exit Sub
End If
End Sub
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Date Modified File Organization Roadsignologist Excel Discussion (Misc queries) 3 December 18th 08 04:34 PM
date file modified Matthew Excel Discussion (Misc queries) 2 October 11th 06 06:52 PM
Get the date a file was modified JustinP Excel Programming 2 September 5th 06 04:54 AM
insert the date the file was last modified Hoff Excel Discussion (Misc queries) 8 November 21st 05 01:31 PM
Detect if a file is in use or being modified shawb[_2_] Excel Programming 3 June 28th 05 01:04 PM


All times are GMT +1. The time now is 01:50 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"