+ Reply to Thread
Results 1 to 8 of 8

ExecuteExcel4Macro - Print Macro

  1. #1
    Registered User
    Join Date
    10-29-2012
    Location
    Leicester, England
    MS-Off Ver
    Office 2010
    Posts
    9

    Question ExecuteExcel4Macro - Print Macro

    Hi
    I am a self-taught (therefore rubbish) Excel user, I write a number of my own macros often using the "Record it then edit it" method. Using this system I have a piece of code which works reasonably at printing a sheet for me but is a long way from perfect.

    Please Login or Register  to view this content.
    No place can I find a description of the PRINT() macro and the full list of parameters (the number of commas would suggest that there are quite a few).

    Any assistance would be appreciated.
    Last edited by Cutter; 10-29-2012 at 07:02 PM. Reason: Added code tags

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

    Re: ExecuteExcel4Macro - Print Macro

    Why are you using an Excel4Macro to print?

    Couldn't you use VBA's printout?

    Anyway, if you want to find out all the parameters download the MacroFun help file from here http://support.microsoft.com/kb/128185?wa=wsignin1.0.

  3. #3
    Registered User
    Join Date
    10-29-2012
    Location
    Leicester, England
    MS-Off Ver
    Office 2010
    Posts
    9

    Re: ExecuteExcel4Macro - Print Macro

    Thanks for such a fast reply, the virtual ink hardly had time to dry.
    I have used the PRINTOUT command but it didn't have a parameter I wanted, I'm just hoping that there is one in the Macro.
    But thanks so much for the help I'm downloading the files now.

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

    Re: ExecuteExcel4Macro - Print Macro

    What parameter is it you want?

    Perhaps it's something that's not accessed via PrintOut.

  5. #5
    Registered User
    Join Date
    10-29-2012
    Location
    Leicester, England
    MS-Off Ver
    Office 2010
    Posts
    9

    Re: ExecuteExcel4Macro - Print Macro

    You are right again, it is not something accessed by PrintOut.

    Ok here is the full problem. I use a virtual printer (DoPDF) to create a .PDF document from Excel sheets. I want a turnkey solution to print the sheet into a specific folder. In the old version of the software (Ver 6) I could do this using the following code:

    Please Login or Register  to view this content.
    This would set the Z:\invoices\maintenance\PDF\ as the default folder for the DoPDF virtual printer.
    However I now have DoPDF ver7 so I made a small change to the code to reflect this:

    Please Login or Register  to view this content.
    So the only change is 4 x 6's changed to 7's. But now the default folder for the virtual DoPDF printer stays at the current users "My Documents" folder. (This is the software default in both V6 & V7).
    I was hoping that one of the parameters in the PRINT() macro woud be a ' set file location' that would force the default folder change.
    Now of course I know the error/change is in the virtual printer but I was looking for an Excel 'work around'. I am looking for a proper answer from the DoPDF software writers too.
    Last edited by Cutter; 10-29-2012 at 07:01 PM. Reason: Added code tags

  6. #6
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

    Re: ExecuteExcel4Macro - Print Macro

    If you want to change the printer you can do it with Application.ActivePrinter.
    Please Login or Register  to view this content.
    Mind you Excel 2010 can save as PDF.

  7. #7
    Registered User
    Join Date
    10-29-2012
    Location
    Leicester, England
    MS-Off Ver
    Office 2010
    Posts
    9

    Re: ExecuteExcel4Macro - Print Macro

    Yes I have used the Application.ActivePrinter = "doPDF v7 on DOP7:" command as well as the embedded macro command (belt and braces I know but was clutching at straws).

    Anyway it is of no matter as you have given me the perfect 'workaround'. How could I not have considered the SaveAs PDF option. It is almost perfect and certainly good enough to be going on with until I get a fix for DoPDF. I still like there soft printer for non-office products and the ability to embed fonts and save in low quality (gives a file 50% the size of Excels).

    I can't thank you enough, cheers for the assist.

  8. #8
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: ExecuteExcel4Macro - Print Macro

    @ Franco403

    Welcome to the forum.

    Based on your last post it seems that you are satisfied with the solution(s) you've received but you haven't marked your thread as SOLVED. I'll do that for you now but please keep in mind for your future threads that Rule #9 requires you to do that yourself. If your problem has not been solved you can use Thread Tools (located above your first post) and choose "Mark this thread as unsolved".
    Thanks.

    Also, as a new member of the forum, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

+ 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