PC Review


Reply
Thread Tools Rate Thread

Convert excel sheet to pdf, faulty vba code

 
 
New Member
Join Date: Mar 2010
Posts: 1
 
      5th Mar 2010
Hi,

I have a macro in excel to save a sheet to pdf with a defined filename and location. This code have been working untill now, getting the 1004 error, document not saved.
Anyone out there who could figure this one out?

My Code:
Sub printpdf()

Application.ScreenUpdating = False

myfilenumber = CStr(ActiveSheet.Range("F2") & ActiveSheet.Range("G2"))
MyFilename = "C:\Users\......\skjema\FR\FR-" + myfilenumber + "- " + ActiveSheet.Range("E14") + ".pdf"


ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
MyFilename, Quality:=xlQualityStandard, _
IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:= _
True



End Sub

Regards Terje
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel code convert to Access code - Concat & eliminate duplicates italia Microsoft Access Queries 1 12th Sep 2006 07:22 PM
Excel code convert to Access code - Concat & eliminate duplicates italia Microsoft Access 2 12th Sep 2006 06:13 PM
Excel code convert to Access code - Concat & eliminate duplicates italia Microsoft Access Macros 0 12th Sep 2006 05:04 PM
Excel code convert to Access code - Concat & eliminate duplicates italia Microsoft Excel Programming 1 12th Sep 2006 12:14 AM
excel - macro code to open a protected sheet, enter passowrd, and then protect sheet arunjoshi Microsoft Excel Programming 1 2nd May 2004 03:50 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:38 PM.