Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() How do you "execute" a VBA "function". I'm trying to use the following code (found on the net) to check whether a file exists when a workbook is activated. If the file doesn't exist I want to save a copy of the workbook as a given name "Master Template". Function FileExist(sTestFile As String) As Boolean sTestFile = "C:\Business Cases\Master Template.xls" Dim lSize As Long On Error Resume Next lSize = -1 lSize = FileLen(sTestFile) If lSize < -1 Then ActiveWorkbook.SaveAs Filename:="C:\ROI Business Cases\Master Template.xls", FileFormat:= _ xlNormal, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False _ , CreateBackup:=False End If End Function -- peter.thompson ------------------------------------------------------------------------ peter.thompson's Profile: http://www.excelforum.com/member.php...o&userid=29686 View this thread: http://www.excelforum.com/showthread...hreadid=501319 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Newbie Question... | New Users to Excel | |||
Real Newbie newbie question | New Users to Excel | |||
Newbie Question - Subtraction Formula Question | Excel Discussion (Misc queries) | |||
Newbie question | Excel Programming | |||
Newbie Question .. what's this | Excel Programming |