locked
Requirements for creating Excel-files RRS feed

  • Question

  • I am not entirely sure this is the correct forum for this question but all the other forums on MSDN seemed even less appropriate. Here goes:

    My employer runs ClearQuest on a Windows server. CQ uses hooks written in vbscript that export data out of the database and into Excel files or re-import them. My employer also doesn't like MS office being installed on the server and asks for a solution.

    My question is, what are the minimum requirements that need to be met in order for the scripts to be able to create and read Excel-files programmatically? Is there a DLL package or something that allows me to do it without "Excel being installed". Having a license to run Excel is not a problem. I wouldn't want the solution to look like a hack though.

    Thanks in advance.

    Monday, December 1, 2008 4:55 PM

Answers

  • Hi Pascalis,


    Thanks for your request.

    You are right, this is not the best place for this question.

    It sounds to me like a general VB / Office forum might be more appropriate but I'm not an expert in Office technologies myself.

    Someone from my team with more suitable skills will contact you later and will be able to route you in the best direction.

    However, I do have a couple questions/suggestions in the meanwhile:

    1) Would you consider the possibility to export into CSV or similar format for portability purposes? That would make the files importable to/from more technologies than Excel should you ever need to.

    2) If you do need to export/import to/from Excel, and installing Excel into the server is not an option, you can try using the Interop Assemblies (http://msdn.microsoft.com/en-us/library/aa159923(office.11).aspx).

    I hope that I've answered your question or at least clarified some of your thoughts.

    As I stated before, I'll forward the request to someone that will be able to help you further if needed.

    Thanks,

    SEBASTIAN CANEVARI - MSFT Senior SEE Protocol Documentation Team
    Tuesday, December 2, 2008 3:18 PM
    Moderator

All replies

  • Hi Pascalis,


    Thanks for your request.

    You are right, this is not the best place for this question.

    It sounds to me like a general VB / Office forum might be more appropriate but I'm not an expert in Office technologies myself.

    Someone from my team with more suitable skills will contact you later and will be able to route you in the best direction.

    However, I do have a couple questions/suggestions in the meanwhile:

    1) Would you consider the possibility to export into CSV or similar format for portability purposes? That would make the files importable to/from more technologies than Excel should you ever need to.

    2) If you do need to export/import to/from Excel, and installing Excel into the server is not an option, you can try using the Interop Assemblies (http://msdn.microsoft.com/en-us/library/aa159923(office.11).aspx).

    I hope that I've answered your question or at least clarified some of your thoughts.

    As I stated before, I'll forward the request to someone that will be able to help you further if needed.

    Thanks,

    SEBASTIAN CANEVARI - MSFT Senior SEE Protocol Documentation Team
    Tuesday, December 2, 2008 3:18 PM
    Moderator
  • Pascalis, 

    There is a kb article that provides some guidance http://support.microsoft.com/default.aspx/kb/257757 around service side solution options.

    One option as mentioned in the kb article is you might want to consider is using the Open XML file format that is the default file format for Office 2007.   The file format is based on a zip file format that contains xml files that can be exploited through .NET and the via System.IO.Package.IO namespace.

    You can find additional developer information specific to the Open XML format here on MSDN: http://msdn.microsoft.com/en-us/office/aa905545.aspx

    And there is some good content that can be found here http://openxmldeveloper.org/default.aspx

    If this is not a viable solution I would look at some third-party software vendors that have solutions that allow for reading and writting of the Office binary file format.
    Developer Consultant
    Tuesday, December 2, 2008 9:01 PM
  •  

    Hello Pascalis,

     

    I am on the Microsoft Open Protocols team.  If I understand your question, you need to read Excel/XLS files without having Office installed on the machine where you will be reading.

     

    The simplest scenario to meet this need is what Sebastian indicated in his response (1) Export the files in CSV then read/import them easily with many other applications.  An alternative, if the documents are Office 2003, is the Microsoft Excel Viewer, which you can download here, http://www.microsoft.com/downloads/details.aspx?FamilyID=c8378bf4-996c-4569-b547-75edbd03aaf0&displaylang=EN.  The Excel viewer provides read-only viewing, so the spreadsheet views are not editable.   Otherwise, without having Office components installed where you will be reading the XLS files your options are limited to implementing your own parser/reader via the Open Protocol Specification, [MS-XLS] Excel Binary File Format, http://msdn.microsoft.com/en-us/library/cc313154.aspx.  This is a non-trivial task.  However, if this is the direction you choose to take then the correct forum to discuss questions related to this Open Protocol specification is, http://social.msdn.microsoft.com/Forums/en-US/os_binaryfile/threads/

     

    Regards,

    Mark Miller, US-CSS DSC PROTOCOL TEAM

    Wednesday, December 3, 2008 2:10 PM
    Moderator
  • Thanks for your answers everyone.

    My employer already has code written to make the export and import to and from Excel files and I am supposed to change as little in the process as possible. The InterOp Assemblies seem to be the least costly way to do it, so I will check that first. I read about them before asking but couldn't quite figure out if they would work for me.

    CSV is not enough for our needs since formatting is lost. I will look at other formats though. It's an obvious possibility and I feel ashamed that I didn't have that idea myself.

    I think writing a parser for the Binary File Format is too expensive timewise. I suppose "non-trivial" is a bit of an understatement.

    Regards
    Pascalis
    Monday, December 8, 2008 2:01 PM