>Naomi,
>
>Sorry but I still did not get my coffee so I can barely understand anything yet.
>
>>Here is the idea of my code:
>>
>>If I found, that the file I want to create is currently opened by Excel, I want to bring Excel to front, let the users close it, and then proceed with creating Excel and opening it again.
>
>Do you really need user intervention? I do not see the point unless they know they will need to "Save AS", otherwise any changes they will do will be overwrited, wouldn't it?
>
>Maybe something like this works for you?
>
>
>lcFileName = 'SomeDrive:\SomePath\SomeFile.XLS'
>loBook = Getobject(lcFileName)
>loExcel = loBook.Application
>loBook.Close(.f.)
>loExcel.Quit()
>
>
Ha :) Both you and on Russian web-site where I discuss the same problem suggest various workarounds. But I want to make my code/idea work! Stubborn, perhaps. I'm thinking, what if they changed something and want to save?
Anyway, my current code (with the slight modification of Excel.hwnd) works, so I may leave it like that, since I have to solve different more important and urgent problems and this was something I artificially created for myself.
But your future ideas are more than welcomed, as well as somebody's else.
If it's not broken, fix it until it is.
My Blog