Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2004
    Posts
    6

    Unanswered: Printing an Excel document Without user intervention

    I am trying to print an Excel sheet (stored on a server) on a client side. Usually what I do is when the client clicks on a print button on the webinterface then I open the excel sheet to the user from the server and then client prints that document.

    Because of some added requirements, I should not show the document to the client but just directly print ( To avoid any modification of the document)on his printer. Does anybody know how could I do it?

    Thanks.

  2. #2
    Join Date
    Mar 2004
    Posts
    6

    Re: Printing an Excel document Without user intervention

    Can anybody help me?

  3. #3
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1

    Re: Printing an Excel document Without user intervention

    Originally posted by butxi
    Can anybody help me?
    Create a macro in Excel that would print the worksheet and close the application. It should run on worksheet open event. This way, users won't have any chance to mess with the document.

  4. #4
    Join Date
    Mar 2004
    Posts
    6

    Re: Printing an Excel document Without user intervention

    Thanks for your reply, but I don´t know how to do it. Could you tell me any web, or something like that, to see it?

  5. #5
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1

    Re: Printing an Excel document Without user intervention

    Originally posted by butxi
    Thanks for your reply, but I don´t know how to do it. Could you tell me any web, or something like that, to see it?
    While in your Excel document, open VB editor and paste this:
    PHP Code:
    Sub workbook_open()
        
    Worksheets(1).PrintOut
        Application
    .Quit
        
    End Sub 
    This will print the first sheet of the document and exit.

    To learn more I suggest you buy any book about programming in Visual Basic for Applications (VBA).

    Or you can go to http://msdn.microsoft.com/library/ and browse the Office Solutions section.

Posting Permissions

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