+ Reply to Thread
Results 1 to 4 of 4

Prinout function

  1. #1
    Chris
    Guest

    Prinout function

    Hello,

    Trying to get a grasp of the VB stuff behind a spreadsheet. I am trying to
    print the current spreadsheet so am trying to use the printout function.

    I think I am using the [PrToFileName] property incorrectly but I do not know
    what it expects. An example of what I have tried is:
    me.PrintOut (,,,,,TRUE,,"U:\weeklyreport")

    How do you define the file name to print the current spreadsheet to?

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello Chris,

    You should use the named arguments when calling the function...

    me.PrintOut PrintToFile:="True", PrToFileName:="C:\My Documents\My File.xls"

    Just change the print to file name string to include the path (if different from the current directory) and the file name.

    Sincerely,
    Leith Ross

  3. #3
    Chris
    Guest

    Re: Prinout function

    Thankyou for your help Leith,

    Do you what format the output file is? I save it as an Excel file, but it
    brings up warnings and is in an unrecorgnisable bunch or jargon.
    If I do not save it as a xls, it is an unattributed file, and it doens't
    work as a .doc either.

    I wish to save it as a excel file.

    Any tricks?

    "Leith Ross" wrote:

    >
    > Hello Chris,
    >
    > You should use the named arguments when calling the function...
    >
    > me.PrintOut PrintToFile:="True", PrToFileName:="C:\My Documents\My
    > File.xls"
    >
    > Just change the print to file name string to include the path (if
    > different from the current directory) and the file name.
    >
    > Sincerely,
    > Leith Ross
    >
    >
    > --
    > Leith Ross
    > ------------------------------------------------------------------------
    > Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465
    > View this thread: http://www.excelforum.com/showthread...hreadid=497789
    >
    >


  4. #4
    cush
    Guest

    Re: Prinout function

    Chris

    Try turning on your macro recorder, then printing or saving the file as you
    wish.
    Turn off the recorder and look at the code.

    "Chris" wrote:

    > Thankyou for your help Leith,
    >
    > Do you what format the output file is? I save it as an Excel file, but it
    > brings up warnings and is in an unrecorgnisable bunch or jargon.
    > If I do not save it as a xls, it is an unattributed file, and it doens't
    > work as a .doc either.
    >
    > I wish to save it as a excel file.
    >
    > Any tricks?
    >
    > "Leith Ross" wrote:
    >
    > >
    > > Hello Chris,
    > >
    > > You should use the named arguments when calling the function...
    > >
    > > me.PrintOut PrintToFile:="True", PrToFileName:="C:\My Documents\My
    > > File.xls"
    > >
    > > Just change the print to file name string to include the path (if
    > > different from the current directory) and the file name.
    > >
    > > Sincerely,
    > > Leith Ross
    > >
    > >
    > > --
    > > Leith Ross
    > > ------------------------------------------------------------------------
    > > Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465
    > > View this thread: http://www.excelforum.com/showthread...hreadid=497789
    > >
    > >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1