Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.



Windows 7: need excel vba help wtith making pdf files

26 Dec 2010   #1

win 7 x64
 
 
need excel vba help wtith making pdf files

Hi, I would like to save my excel sheet as PDF + print that sheet on my local printer (so changing default printer to Adobe PDF printer will not work)

I searched help database and I found two commands that by my logics could work - PRINTOUT and EXPORTASFIXEDFORMAT.
Now for the first comand I wrote:
Code:
 
Sub Macro1()
Application.Activate = "Adobe_PDF_Converter" 'that's how my pdf printer is labeld
ActiveSheet.PrintOut prewiew:=False, _
ActivePrinter:=Adobe_PDF_Converter, _
printofile:=True, _
PrToFileName:="C:\users\borut\desktop\primer.pdf"
End Sub
but I get the error
runtime error '438':
object doesn't support this property or method

and for the second:
Code:
 
Sub Macro2()
ActiveDocument.ExportAsFixedFormat OutputFileName:= _
"C:\Users\borut\Desktop\test.pdf", ExportFormat:=xlTypePDF
End Sub
but I got the error:
runtime error '424':
object required

My System SpecsSystem Spec
.

27 Dec 2010   #2

Windows 7 Home Premium 64bit
 
 

Here is a MicroSoft add-in for that purpose in Office 2007...
Download details: 2007 Microsoft Office Add-in: Microsoft Save as PDF


.
My System SpecsSystem Spec
27 Dec 2010   #3

win 7 x64
 
 

Quote   Quote: Originally Posted by Irene View Post
Here is a MicroSoft add-in for that purpose in Office 2007...
Download details: 2007 Microsoft Office Add-in: Microsoft Save as PDF


.
Does anyone here read the questions???

Office 2007+ allow to save as PDF, plus I have adobe PDF printer. What I need is help with the macro code!
My System SpecsSystem Spec
.


27 Dec 2010   #4

Microsoft Community Contributor Award Recipient

Windows 7 SP1, Home Premium, 64-bit
 
 

I have an Excel macro that works, but I am far far from an authority or knowledgeable. I eventually got it to work through fumbling, trial and error, and googling.

Google generates 630,000 hits for "runtime error 438". I can only suggest you drill into some of them.

But only 47 for "runtime error 434". Hmmmm.......................

I'd look at 434 rather than 438.

Microsoft used to have a series of Excel newsgroups, but I think they have been replaced by online forums similar to this one.

Good luck. Put on your sheepskin chaps and put a knife in your teeth. You may be in for a long haul and a lot of frustration.

But they are very cool when finished and they work!!
My System SpecsSystem Spec
27 Dec 2010   #5

win 7 x64
 
 

Quote   Quote: Originally Posted by ignatzatsonic View Post
I have an Excel macro that works, but I am far far from an authority or knowledgeable. I eventually got it to work through fumbling, trial and error, and googling.

Google generates 630,000 hits for "runtime error 438". I can only suggest you drill into some of them.

But only 47 for "runtime error 434". Hmmmm.......................

I'd look at 434 rather than 438.

Microsoft used to have a series of Excel newsgroups, but I think they have been replaced by online forums similar to this one.

Good luck. Put on your sheepskin chaps and put a knife in your teeth. You may be in for a long haul and a lot of frustration.

But they are very cool when finished and they work!!
The answer should be simple and easy, of course for someone that knows where the problem is. I googled it, but as you mentioned did not help me, even with my knife beetwen my teeth.
My System SpecsSystem Spec
27 Dec 2010   #6

Microsoft Community Contributor Award Recipient

Windows 7 SP1, Home Premium, 64-bit
 
 

My System SpecsSystem Spec
27 Dec 2010   #7

Windows 7 Home Premium 64bit
 
 

Quote   Quote: Originally Posted by mihael View Post
Quote   Quote: Originally Posted by Irene View Post
Here is a MicroSoft add-in for that purpose in Office 2007...
Download details: 2007 Microsoft Office Add-in: Microsoft Save as PDF
Does anyone here read the questions???

Office 2007+ allow to save as PDF, plus I have adobe PDF printer. What I need is help with the macro code!
Quote   Quote: Originally Posted by mihael View Post
The answer should be simple and easy, of course for someone that knows where the problem is. I googled it, but as you mentioned did not help me, even with my knife beetwen my teeth.
I can certainly feel it!

Did anyone mention to you that this is the season of goodwill?
Attitude does not produce answers...

.
My System SpecsSystem Spec
27 Dec 2010   #8

win 7 x64
 
 

Quote   Quote: Originally Posted by Irene View Post
Did anyone mention to you that this is the season of goodwill?
Attitude does not produce answers...
...answers like yours are not even answers since you don't read a question. I don't want to be rude, but if I don't know a thing about a topic in the question I don't give a useless advice.
My System SpecsSystem Spec
27 Dec 2010   #9

win 7 x64
 
 

Quote   Quote: Originally Posted by ignatzatsonic View Post
I tried to register on the VBA Express Forum but I don't get any confirmation email on my gmail, I aslo sended email to administrator that I dind't receive their confirmation email and I didn't get any reply (that was three days ago)

I aslo tried on VB.Forums and jet no answer...
My System SpecsSystem Spec
27 Dec 2010   #10

Windows 7 Ultimate x64 SP1
 
 

Quote   Quote: Originally Posted by mihael View Post
Quote   Quote: Originally Posted by Irene View Post
Did anyone mention to you that this is the season of goodwill?
Attitude does not produce answers...
...answers like yours are not even answers since you don't read a question. I don't want to be rude, but if I don't know a thing about a topic in the question I don't give a useless advice.
Hang on, mihael! I've got the answer you are seeking, I use it all of the time in conjunction with my AutoCad Architecture PDF files I create for clients. I use Access to do general billing but create complicated bids with Excel, convert to a PDF and then print. I also prepare an email for the client by starting a new mail and attaching the PDF in the same VBA code.

If you had been a little nicer I might have posted the code for you.
My System SpecsSystem Spec
Reply

 need excel vba help wtith making pdf files





Thread Tools



Similar help and support threads for2: need excel vba help wtith making pdf files
Thread Forum
Excel files are not opening Microsoft Office
open XLA files in excel Microsoft Office
My excel files can't open Microsoft Office
Files won't open once associated with Excel Microsoft Office
can't open (excel) files Microsoft Office
emailed excel files but downloads are xml files Microsoft Office
Can't open 2003 Excel Files in Excel 2007? Microsoft Office

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 08:51 AM.
Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App
  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33