How to tell if Spread xml file is already open

Posted by: sally on 19 May 2020, 6:01 am EST

  • Posted 19 May 2020, 6:01 am EST

    Hi,
    We used streaming to open and close the Spread xml file. We could tell if the file was open and in use; however streaming took up more resources (customers were getting out of memory errors) so we disabled streaming and just use the spread open and save commands. The problem is that we can no longer see if the xml file is already open and in use like we could with streams. I have devised a work-around but I want to know if you are aware of any way to tell if the spread xml is already open and in use.

    Thanks,
    Sally
  • Replied 20 May 2020, 4:54 am EST

    Hello Sally,

    Did you try using the WorkbookData property of FpSpread after loading XML files in spread?
    Otherwise, you can share the workaround you are using so, we can discuss it with team whether there are any better solutions.

    Thanks,
    Ruchir
  • Replied 21 May 2020, 4:53 am EST

    Hi Ruchir,
    Thanks for replying. I can't find this property for FpSpread. I don't see any workbook properties for FpSpread.

    Anyway, my workaround is this: prior to opening the spread file to the spread control, I open it using xml and check a true/false flag in a particular row/column (that I update when I close the file). On a true response, the file is in use; otherwise it's available.

    This works well with one exception, if the application aborts for any reason, the flag doesn't get changed to show that's it's no longer in use.

    This may be the best I can do.
    Thanks,
    Sally
  • Replied 22 May 2020, 3:24 am EST

    Thank you, Sally.
    The property is not available in intellisense, may be that's why you could not find it.
    I have anyways forwarded your request to the developer[ID:SPNET 7400]. I will get back to you once there is some information.

    Thanks,
    Ruchir
  • Marked as Answer

    Replied 23 May 2020, 4:15 am EST

    Hi Sally,

    I have received information from the developer that Spread doesn't lock the file after it is finished opening. It means that there is no difference between a spread, which set data manually, than a spread, which open the XML file.
    If your application need to keep track that the XML file is opened, you need to maintain a flag inside the application to turn on/off.

    Hope that helps!

    Regards,
    Ruchir
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels