Excel files with VBScript

Discussion in 'Software' started by jazzdrive, Apr 12, 2005.

  1. jazzdrive

    jazzdrive Private E-2

    I can't seem to open and create Excel files with VBScript. Here's my code:

    oExcel = CreateObject("Excel.Application")


    It gives me this error:

    Microsoft VBScript runtime error '800a01ad'

    ActiveX component can't create object: 'Excel.Application'

    I try it like this:

    oExcel = Server.CreateObject("Excel.Application")

    And it gives me this error:

    Server object error 'ASP 0177 : 800401f3'

    Server.CreateObject Failed

    /FullReport.asp, line 7

    800401f3

    This is very frustrating. Any help would be very much appreciated.

    Thanks.
     
  2. Kodo

    Kodo SNATCHSQUATCH

    doing that is telling the server to create an instance excel on the server via the launching of excel. This is prohibited.
     
  3. jazzdrive

    jazzdrive Private E-2

    Well how do you create an excel object?
     
  4. Kodo

    Kodo SNATCHSQUATCH

    You can't create an excel object on the server. What are you trying to accomplish?
     
  5. jazzdrive

    jazzdrive Private E-2

    The user will click on a button, and the information in the access database will be exported to an excel file and saved on their computer.

    Thanks.
     
  6. Wookie

    Wookie Sergeant Major

    Your probably gonna have to call your host and see if they allow the creation of activex objects on the server...it is a security risk and may be disabled.
     
  7. Kodo

    Kodo SNATCHSQUATCH

    well the cool thing about excel is the data is essentially formatted in XML.. additionally, you can open HTML in it. HTML tables will be read by excel as columns and rows. You know where I'm going with this.. :)
     
  8. jazzdrive

    jazzdrive Private E-2

    It's our own in house server. I'm working on an Intranet site.
    How would I do what you're talking about? How can I send information to excel if I can't open an excel file?

    Thanks,
     
  9. Kodo

    Kodo SNATCHSQUATCH

  10. jazzdrive

    jazzdrive Private E-2

    Ah thank you. That is what I needed. Much obliged.
     
  11. jazzdrive

    jazzdrive Private E-2

    Actually, nevermind. I can't create the OWC.Spreadsheet object. It gives me the same error.

    System.Web.HttpException: Could not create an object of type 'OWC.Spreadsheet'.
     
  12. Kodo

    Kodo SNATCHSQUATCH

    do you have office 2000 or higher installed on that server?
     
  13. jazzdrive

    jazzdrive Private E-2

    Ah it works now. Thanks. One thing though is that Microsoft documentation for this thing is absolutely horrid. How the crap do you horizontally center align something in a cell? I see the HAlignment property, but they don't give you the constants or values for it. What good is that?
     
  14. Kodo

    Kodo SNATCHSQUATCH

    it's probably a boolean. You have left, center or right.. so i would venture HAlignment=True is the way to go.
     

MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds