Results 1 to 10 of 10
  1. #1
    Join Date
    Jan 2004
    Posts
    65

    Exclamation Unanswered: HELP - urgent situation.. can't instantiate Excel.Application on server?

    Hey all

    I've got a DTS package with a script that does this:

    Set xlApp = CreateObject("Excel.Application")

    This fails though. Do I have to install MS Office on the machine the SQL Server is on? Or can I simply copy a few DLLs over and register them??

    Thanks! I gotta get this solved within 5 hrs
    Last edited by MDesigner; 02-10-04 at 07:17.

  2. #2
    Join Date
    Dec 2002
    Posts
    1,245

    Re: HELP - urgent situation.. can't instantiate Excel.Application on server?

    I am by no means an expert on this particular situation, but I would think that your 'best' (meaning most likely to work the first time) solution would be to install MS Office (just the Excel portion of it) on the server.

    Regards,

    hmscott

  3. #3
    Join Date
    Jan 2004
    Posts
    65
    Our in-house IT guy won't install Excel/Office on the server that our SQL Server is on.. something about opening up for potential problems and/or security issues.

    It seems to me that if you CreateObject("Excel.Application"), that there's some kind of ActiveX .dll that could be registered on the server to allow the creation of these Excel COM objects. Anyone know which files they are??

  4. #4
    Join Date
    Jan 2004
    Location
    Ottawa, Canada
    Posts
    53

    Re: HELP - urgent situation.. can't instantiate Excel.Application on server?

    Where is the Package called from?

    If client side app I would suggest installing Excel would work,

    If a VB app adding the Excel distributables in the compile should work.

    Create a reference to the Excel Object in your VB app.

    mine is at
    C:\Program Files\Microsoft Office 2000\Office\EXCEL9.OLB

    When installed the required registry entries should follow.

    Good Luck

  5. #5
    Join Date
    Jan 2004
    Posts
    65
    It's an ActiveX script within a DTS package on the server. I'd LIKE to have Office installed, but IT won't allow it.

    Is there some way I could place the EXCEL9.OLB file on the server, and reference it somehow in my VBScript??

  6. #6
    Join Date
    Jan 2004
    Location
    Ottawa, Canada
    Posts
    53
    All DTS Packages are run on the client unless scheduled by SQL Server regardless of where the code resides.

    Your users will need Excel on their PC to use the output anyway, as well as DTS dlls (read SQL Server Client).

    Is XML an option? or a structured text file which they can import into Excel. If so you could use the fileScripting object in Active script.

  7. #7
    Join Date
    Jan 2004
    Posts
    65
    Well.. actually this is a web page executing the DTS package.. so all the proper DTS dlls are installed on the web server now. And the DTS package has an ActiveX script that tries to create an instance of Excel.Application..but can't do so because Office is not installed on the web server (and will never be).

    Nope.. XML is not an option. They gave us an Excel workbook they want populated.. there's no room to budge on this, unfortunately.

  8. #8
    Join Date
    Jan 2004
    Location
    Ottawa, Canada
    Posts
    53
    If all you are doing is a data migration into a template try to map to the Excel spreadheet and se a dtsDataPump

  9. #9
    Join Date
    Jan 2003
    Location
    Massachusetts
    Posts
    5,800
    Provided Answers: 11
    What if you pumped the data to a Comma Separated Value file (.csv), and let Excel convert it from wherever the client happens to open it from?

  10. #10
    Join Date
    Jan 2004
    Posts
    65
    OK here's the solution we went with.. MS Office Web Components.

    Problem is, I can't find any thorough documentation on it. I want to know if it's possible to open an Excel file with it.

    Set objOWC = CreateObject("OWC10.Spreadsheet")

    That's how it's created. I have a few examples that tell you how to create a new Excel file from scratch and save it. But not how to open an existing one, modify it, then save to a new file.

    Does anyone know, or can point me to some documentation? Thanks!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •