Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to skip files which are open?
I run update macro loop to process about 50 spreadsheets, but sheets could
be used (open) by somebody. I need to skip processing of the sheet if it is open. Something like this: For R = 1 to 50 If FileR is open then goto Skip '<======This is what I need Open_sheet Update_it Save_and_Close_it Skip: Next R Thanks for your help Jan |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to skip files which are open?
Jan,
Something like the following... Jim Cone San Francisco, USA http://www.realezsites.com/bus/primitivesoftware '---------------------- Sub OpenClosedFilesOnly() Dim R For R = 1 To 50 If Not IsItOpen(FileR) Then Open_sheet Update_it Save_and_Close_it End If Skip: Next R End Sub ' Returns True or False. '------------------ Function IsItOpen(ByRef BookName As String) As Boolean Dim WB As Workbook On Error Resume Next Set WB = Workbooks(BookName) IsItOpen = (Err.Number = 0) Set WB = Nothing End Function '------------------------------------------------ "Jan Nademlejnsky" wrote in message I run update macro loop to process about 50 spreadsheets, but sheets could be used (open) by somebody. I need to skip processing of the sheet if it is open. Something like this: For R = 1 to 50 If FileR is open then goto Skip '<======This is what I need Open_sheet Update_it Save_and_Close_it Skip: Next R Thanks for your help Jan |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to change default Open/Files of Type to "Microsoft Excel Files | Excel Discussion (Misc queries) | |||
Macro to open *.dat files and save as .txt (comma delimited text files) | Excel Programming | |||
Open files, skip a folder | Excel Programming | |||
file open via IE hyperlink causes already open files to shrink and tile | Setting up and Configuration of Excel | |||
Open files in folder - skip if already open | Excel Programming |