Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello,
I have a macro that opens each file in a directory, copies some data into another file, and then closes each file. Sometimes, after I ran the macro, messages pop up asking whether I want to open one of more of the files in the directory in Read-Write mode. I think this is because my macro opened some files that were in use by others (and so it opened them in a Read-Only mode) and were subsequently closed. Is there a way to eliminate this message? Thanks very much for your help! Magnivy |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Maybe you can incorporate something like this into your loop:
Dim wkbk As Workbook Set wkbk = Workbooks.Open(Filename:="C:\my documents\excel\book3.xls") If wkbk.ReadOnly Then MsgBox wkbk.FullName & " is readonly--closing" wkbk.Close savechanges:=False Else 'do the work?? end if Magnivy wrote: Hello, I have a macro that opens each file in a directory, copies some data into another file, and then closes each file. Sometimes, after I ran the macro, messages pop up asking whether I want to open one of more of the files in the directory in Read-Write mode. I think this is because my macro opened some files that were in use by others (and so it opened them in a Read-Only mode) and were subsequently closed. Is there a way to eliminate this message? Thanks very much for your help! Magnivy -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
I have a read only xl file, I need it to be read and write | Excel Discussion (Misc queries) | |||
How can a file be converted from Read-Only to Read/Write | Excel Discussion (Misc queries) | |||
Cannot eliminate Clipboard Message | Excel Programming | |||
"file available for read/write" message | Excel Programming |