+ Reply to Thread
Results 1 to 7 of 7

excel run-time error -2147024773 (8007007b) and beforeprint event

  1. #1
    Registered User
    Join Date
    12-21-2017
    Location
    Mexico
    MS-Off Ver
    Proffesional Plus 2010
    Posts
    8

    excel run-time error -2147024773 (8007007b) and beforeprint event

    Good day I'm having the same troubles that this post (https://www.excelforum.com/excel-pro...-8007007b.html), I understand that the format date can't be used with range and VBA, but there is other way to use the content of the cell in that format?

    I'm using this code...

    Sub Boton1_Haga_click_en()



    nombreLibro = Range("H4")
    Ruta = "D:\Users\MXQUEJEN\Desktop\"

    ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, filename:= _
    Ruta & nombreLibro & ".pdf", Quality:=xlQualityStandar, IncludeDocProperties:= _
    True, IgnorePrintAreas:=False, OpenAfterPublish:=True

    End Sub

    I want to save a PDF document with the name of the cell in this case H4 with a format in a custom format mdyyhmms... but H4 have a copy of H3 that have the formula =NOW(). And I want the name of the PDF file is the date in date format. All this I want to included in a beforprint event.. is this possible?

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,525

    Re: excel run-time error -2147024773 (8007007b) and beforeprint event

    If H4 has a date in it then,

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    12-21-2017
    Location
    Mexico
    MS-Off Ver
    Proffesional Plus 2010
    Posts
    8

    Re: excel run-time error -2147024773 (8007007b) and beforeprint event

    davesexcel

    Thanks, thant's what I need but just one other think...

    The format that I need is not MM-DD-YY is month day year hour minutes seconds like this m dd yy h mm s... I'm trying to set this but now the erros is Can't execute code in breake mode

  4. #4
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,525

    Re: excel run-time error -2147024773 (8007007b) and beforeprint event

    You're in break mode, get out of it.

  5. #5
    Registered User
    Join Date
    12-21-2017
    Location
    Mexico
    MS-Off Ver
    Proffesional Plus 2010
    Posts
    8

    Re: excel run-time error -2147024773 (8007007b) and beforeprint event

    davesexcel

    Sorry. I have found that the code was still running... And I solved the problem just adding (MM-DD-YY-h-mm-ss)

    Thanks, for your help.

  6. #6
    Registered User
    Join Date
    12-21-2017
    Location
    Mexico
    MS-Off Ver
    Proffesional Plus 2010
    Posts
    8

    Re: excel run-time error -2147024773 (8007007b) and beforeprint event

    Now... I want this macro runs when I send to print the file...

    I set this Marco into "ThisWorkbook"

    Please Login or Register  to view this content.
    But now it says "Compile error: Sub or Function not defined"

    Does this code BeforPrint must be in the same Macro?

  7. #7
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,525

    Re: excel run-time error -2147024773 (8007007b) and beforeprint event

    I'm not familiar with print to file.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] excel run-time error -2147024773 (8007007b)
    By ZeDoctor in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-21-2017, 01:03 PM
  2. Excel 2010, Excel 2013 BeforePrint Event Trigger (Before Print Preview)
    By mikepfly2 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-13-2015, 03:43 PM
  3. BeforePrint event does not work for print preview in Excel 2010
    By MSApprentice in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-08-2015, 08:19 PM
  4. Excel VBA: BeforePrint Error When Printing to pdf
    By lway in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-12-2012, 01:06 PM
  5. VBA Application Event - BeforePrint
    By jeremyhamblen in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-22-2009, 04:29 AM
  6. [SOLVED] printing macro,want to use beforeprint event?
    By paul in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-02-2006, 03:05 PM
  7. BeforePrint Event
    By Woody in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-20-2005, 05:05 AM

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