Results 1 to 3 of 3

Thread: How to Run Excel Macros from ASP

  1. #1
    Join Date
    Jun 2009
    Posts
    39

    How to Run Excel Macros from ASP

    Hello Friends,
    am currently working with a project which is basically in a Asp platform,for that I need to call an existing Excel macro from ASP.for example

    Set objExcel = New Server.create object("Excel.Application")
    ....................
    ....................
    ....................
    objExcel.Run("macro-name")

    but it fails to run..i need to get some inputs to succeed I understand that my ASP doesn't seem to understand Excel.Application and .Run command.
    any help would be greatly received ...
    thanks for reading me

  2. #2
    Join Date
    May 2008
    Posts
    2,389

    Re: How to Run Excel Macros from ASP

    I was in search for a remedy to this and I finally some inputs it but i don't know what about your exact situation
    For this I created a macro in the Excel file:

    Sub PAll()
    Application.ActivePrinter = "\\SERVER\Printername on Ne02:"
    ActiveWindow.SelectedSheets.PrintOut Copies:=1
    Application.Quit
    End Sub

    I have exhausted consider amount of time to get a better output
    Dim xls
    Set xls = CreateObject("Excel.Application")
    xls.Application.Visible = False
    ' 3 is the value for "xlReadOnly"
    xls.Workbooks.Open ExcelFilePath, 3, False
    xls.Run("ThisWorkBook.PAll")
    Set xls = Nothing
    while your Macro does not have a command to quitthe application
    xls.Application.but you need to Quit before setting the var to nothing.

  3. #3
    Join Date
    Feb 2008
    Posts
    1,852

    Re: How to Run Excel Macros from ASP

    have you tried tried New server.createobject, New createobject Server.CreateObject though that would not make a difference.
    If you need you can peer at the permissions of the folder that the excel file had....

Similar Threads

  1. Excel Autosorting without Macros
    By rnwatson in forum Windows Software
    Replies: 1
    Last Post: 28-02-2012, 07:33 AM
  2. Excel Macros for conditional formatting statement in Excel
    By Kungfu Pandey in forum Microsoft Project
    Replies: 1
    Last Post: 08-01-2012, 08:35 PM
  3. Excel 2007 macros have disappeared
    By LakshanA in forum Windows Software
    Replies: 4
    Last Post: 09-11-2010, 09:13 AM
  4. How to Run Excel 2003 Macros in Excel 2007
    By Ekanga in forum Windows Software
    Replies: 5
    Last Post: 19-07-2010, 02:37 PM
  5. Microsoft Excel VBA (macros list)
    By Samra in forum Windows Software
    Replies: 2
    Last Post: 17-01-2009, 10:04 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,143,591.98912 seconds with 17 queries