PDA

View Full Version : Hide popup when saving as PDF



jaminben
03-18-2012, 01:23 PM
Hello,

I've created a piece of code which saves my workbooks to PDF using the Microsoft export as PDF thingy and it all works ok but I get an annoying popup telling me that its publishing the file.

Does anyone know how I can turn this off?

I've tried:


Application.EnableEvents = False
Application.ScreenUpdating = False


Here's a snippet of my code which saves the file as a PDF:
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, fileName:= _
SaveFileName, Quality:= _
xlQualityStandard, IncludeDocProperties:=False, IgnorePrintAreas:=False, _
OpenAfterPublish:=False


I've also attached a screenshot showing the popup I want to hide.

Many Thanks

Ben

Paul_Hossler
03-18-2012, 03:20 PM
Are you sure that you really want to or need to hide the popup? It just goes away on it's own when it's done

Application.DisplayAlerts = False doesn't affect it


Paul

jaminben
03-18-2012, 03:39 PM
Hi Paul,

Thanks for the speedy reply :)

I tried that line before but it didn't do anything and I wasn't sure if it really applied in this case as its not an alert thats popping up.

Your correct in that it goes away after its completed the task but I'm also executing the macro via an external VB project which batch converts 100's of workbooks at a time.
I'd really like it to completely hide everything excel does so I can just use my external form to display the overall progress of the batch conversion and this is the last thing that needs hiding so it appears excel is running silently.

Any other ideas?

Thanks

Ben

Edit:

Actually where does that code go?

On its own or with this:

ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, fileName:= _
SaveFileName, Quality:= _
xlQualityStandard, IncludeDocProperties:=False, IgnorePrintAreas:=False, _
OpenAfterPublish:=False

jaminben
03-18-2012, 03:44 PM
Ah, your original post seems to have been changed... I was looking at the email I got and it had the line:

Application.DisplayAlerts = wdAlertsNone

Any help appricaited.

Cheers

Ben

Paul_Hossler
03-18-2012, 04:35 PM
yea, I was following a thread in the Word fourm, and I had Word on the brain

I had to shift gears real quick, sorry for confusing you.

Paul

jaminben
03-19-2012, 11:38 AM
yea, I was following a thread in the Word fourm, and I had Word on the brain

I had to shift gears real quick, sorry for confusing you.

Paul

Ok, No problem.

Any other ideas or suggestions I can try?

Thanks

Ben

Paul_Hossler
03-19-2012, 12:21 PM
I had seen (I think) some code to totally 'freeze' the screen until unfrozen later in the macro.

I probably don't have it anymore because of the very high probablity of locking myself out of my own computer :rotlaugh:

As I vaguely recall, it used APIs or did something like assign CON: to NUL: until the macro un-did it later

If I find it, I'll post it

Paul