Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Everyone !
I m a newbie to excel programming but I noticed a bug (??) while working with excel & VS.NET. I m able to open an excel workbook in 2 different instances of my application & I cant find a way to prevent this from happening. As a result, 2 different users can , effectively work on the same workbook, on a same worksheet & over-ride each other's saves !! Pls help if anyone has faced a similar problem & if there is anyway to prevent this ! Thanks in advance ~Ann |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Surely, one of them will open it as read-only, thereby not being able to
write it back. You can test for this property. -- HTH Bob Phillips (remove xxx from email address if mailing direct) "ann" wrote in message ups.com... Hi Everyone ! I m a newbie to excel programming but I noticed a bug (??) while working with excel & VS.NET. I m able to open an excel workbook in 2 different instances of my application & I cant find a way to prevent this from happening. As a result, 2 different users can , effectively work on the same workbook, on a same worksheet & over-ride each other's saves !! Pls help if anyone has faced a similar problem & if there is anyway to prevent this ! Thanks in advance ~Ann |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
That is the problem neither Excel or XP (the OS I am using it with)
detects this & allows me to open & work on the same workbook at the same time. ! Is there someway to check in C# if a file is already open ? I found a lot of code using VB that allows a file to be locked while opening and thereby detecting another open attempt on an already open file. Cannot find anything similar in C# Thanks |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Don't know C#, but as I said, if you open it and then check it's ReadOnly,
which is ActiveWorkbook.ReadOnly in VBA, and act accordingly. -- HTH Bob Phillips (remove xxx from email address if mailing direct) "ann" wrote in message ups.com... That is the problem neither Excel or XP (the OS I am using it with) detects this & allows me to open & work on the same workbook at the same time. ! Is there someway to check in C# if a file is already open ? I found a lot of code using VB that allows a file to be locked while opening and thereby detecting another open attempt on an already open file. Cannot find anything similar in C# Thanks |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks for your prompt replies Bob.
I realised that the solution lies in using the VBA. I was using Interop till now. I was able to check if the file is already open using VBA.FileOpen method. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Open Workbook at a certain time | Excel Worksheet Functions | |||
How do I set up a workbook to open on a cell reference every time | Excel Discussion (Misc queries) | |||
excel exits unexpectedly or hangs the second time I open workbook | Excel Discussion (Misc queries) | |||
Why does Excel 2003 open on 3rd tab of workbook every time, not l. | Excel Worksheet Functions | |||
How to stop having to re-assign macros every time you open a workbook??? | Excel Programming |