View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
raypayette[_33_] raypayette[_33_] is offline
external usenet poster
 
Posts: 1
Default code to check file size everytime an Excel file is opened


Sub FileSize()
Dim oFSO
Dim oFile
Dim oSourceFile
oSourceFile = "D:/Excel/test.xls"
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set oFile = oFSO.GetFile(oSourceFile)
If oFile.Size 5000000 Then
Application.Calculation = xlManual
End If
Set oFile = Nothing
Set oFSO = Nothing
End Sub


--
raypayette


------------------------------------------------------------------------
raypayette's Profile: http://www.excelforum.com/member.php...o&userid=29569
View this thread: http://www.excelforum.com/showthread...hreadid=566359