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
mihael

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
Irene

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
mihael

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
ignatzatsonic

Microsoft Community Contributor Award Recipient

Windows 7 Home Premium SP1, 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
mihael

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
ignatzatsonic

Microsoft Community Contributor Award Recipient

Windows 7 Home Premium SP1, 64-bit
 
 

My System SpecsSystem Spec
27 Dec 2010   #7
Irene

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
mihael

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
mihael

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
mikedl

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
Thread Forum
Excel 2007 Files Are Now Saving with Fewer KB in Both Excel 2007 and 2
The “problem” I’m concerned about is that I noticed existingExcel 2007 xlsx files are now saving with fewer Kb. I have a Lenovo W700ds and a W541. Both computers are running Windows 7 Pro 64bit. The W700 has Office 2007 and theW541 has Office 2013. Both versions ofExcel are 32 bit as far as I...
Microsoft Office
open XLA files in excel
hello i have a .XLA software that is an addin to excel. i would like to add functions to this xla file but dont know how to edit it... is there a way to do this or to know i can do it because the file is protected or something?
Microsoft Office
My excel files can't open
My excel files can't open it shows a message 'hot key 1 not working' what it means..? :(
Microsoft Office
can't open (excel) files
Hi All ... When I am in Explorer and My Documents and I try to double click open an Excel file (Office 2003), I get the error message: "There was a problem sending the command to the program." However, if I try to similarly open a Word, or .PDF, or .TXT file in a similar manner, there is no...
Microsoft Office
Can't open 2003 Excel Files in Excel 2007?
I'm not sure if it because the files are 2003 or not? When I try to open them an error message appears stating, "...the file you are trying to open is in a different format than specified by the file extension. Verify file is not corrupted and is from a trusted source..." These are my files. The...
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 21:17.
Twitter Facebook Google+ Seven Forums iOS App Seven Forums Android App