Wrox Programmer Forums
|
Classic ASP Components Discussions specific to components in ASP 3.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Components section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 3rd, 2003, 09:37 PM
Registered User
 
Join Date: Sep 2003
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Excel.Application

Hi all.
I write an asp page to open an excel file then read/write some cell in that file. Here is my source:

    Dim xlApp
    Dim xlBook
    Dim xlSheet

    Set xlApp = Server.CreateObject("Excel.Application")
    'Set xlBook = xlApp.Workbooks.Add
    Set xlBook = xlApp.Workbooks.Open(Server.MapPath(".") & "\a.xls")
    Set xlSheet = xlBook.Worksheets(1)

    xlApp.Application.Visible = False

    With xlApp.ActiveSheet.Cells(1, 1)
        .Value = "Test"
        .Font.Bold = True
        .Font.Name = "Tahoma"
        .Font.Size = 16
    End With
    xlSheet.SaveAs Server.MapPath(".") & "\a.xls"
    xlApp.Application.Quit

    Response.Write "Finish"
    Response.End

When run this asp, an unexcepted error will occur. This code can run well in VB. Please help.
Thanks!

 
Old September 4th, 2003, 06:05 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 344
Thanks: 0
Thanked 1 Time in 1 Post
Default

sounds like a permissions thing, although check out http://www.greggriffiths.org/webdev/both/excel/ which covers this topic.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Building an Excel like Application yuenli C# 2005 1 June 22nd, 2007 11:57 AM
Excel Application dpkbahuguna Beginning VB 6 2 November 29th, 2006 06:49 AM
write multi-sheet Excel w/o Excel.Application manmoth Classic ASP Components 2 November 22nd, 2005 10:56 AM
Setting a new Excel application Shasur Pro VB 6 1 September 21st, 2005 10:12 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.