Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 01-02-2023, 05:55 PM
psyclone psyclone is offline EXCEL 2007 - Create PDF Windows 10 EXCEL 2007 - Create PDF Office 2007
Novice
EXCEL 2007 - Create PDF
 
Join Date: Jan 2023
Posts: 3
psyclone is on a distinguished road
Default EXCEL 2007 - Create PDF

Hello,
I have Excel 2007, get an error when running the following code to create PFD. I can save the exact code and run it on Office360 no problem.
I'm interested to know if it's my '07' version or does my machine require an Add-in to run it?



Also, apologies regarding my post description, I posted accidentally before completing.

'-------------------------------------------------
Sub CreatePDF()

Worksheets("SCHEDULES").Activate

Dim dte As String
Dim Adr As String
Dim IDw As String
Dim path As String
Dim fname As String
dte = Range("H3").Text
Adr = Range("G2").Text


IDw = Format(dte, "medium Date")


path = "C:\Users\.....\....."
fname = Adr & ", " & IDw & ".pdf"
ActiveSheet.ExportAsFixedFormat _
Type:=xlTypePDF, _
Filename:=path & fname, _
IgnorePrintAreas:=False ' ,_
' OpenAfterPublish:=False


End Sub

'-----------------------------------------------

Last edited by psyclone; 01-02-2023 at 06:04 PM. Reason: Posted accidentally before completion
Reply With Quote
  #2  
Old 01-03-2023, 03:06 AM
p45cal's Avatar
p45cal p45cal is offline EXCEL 2007 - Create PDF Windows 10 EXCEL 2007 - Create PDF Office 2019
Expert
 
Join Date: Apr 2014
Posts: 863
p45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant future
Default

Should there be one more backslash at the end of:
path = "C:\Users\.....\.....\"
What is the error saying.
What line of code is highlighted when you choose Debug?
Reply With Quote
  #3  
Old 01-03-2023, 03:56 AM
psyclone psyclone is offline EXCEL 2007 - Create PDF Windows 10 EXCEL 2007 - Create PDF Office 2007
Novice
EXCEL 2007 - Create PDF
 
Join Date: Jan 2023
Posts: 3
psyclone is on a distinguished road
Default

Quote:
Originally Posted by p45cal View Post
Should there be one more backslash at the end of:
path = "C:\Users\.....\.....\"
What is the error saying.
What line of code is highlighted when you choose Debug?
I edited the path before posting - so yes a backslash is missing in previous post.

Please see attached (I've edited the path in attachment also for privacy). The path leads to the desktop.
Attached Images
File Type: jpg run error.jpg (59.0 KB, 12 views)
Reply With Quote
  #4  
Old 01-03-2023, 04:24 AM
Debaser's Avatar
Debaser Debaser is offline EXCEL 2007 - Create PDF Windows 10 EXCEL 2007 - Create PDF Office 2016
Competent Performer
 
Join Date: Oct 2015
Location: UK
Posts: 221
Debaser will become famous soon enough
Default

Do you have at least SP2 installed with 2007? Prior to that you needed a separate add-in for exporting to PDF.
Reply With Quote
  #5  
Old 01-04-2023, 02:39 AM
psyclone psyclone is offline EXCEL 2007 - Create PDF Windows 10 EXCEL 2007 - Create PDF Office 2007
Novice
EXCEL 2007 - Create PDF
 
Join Date: Jan 2023
Posts: 3
psyclone is on a distinguished road
Default

Quote:
Originally Posted by Debaser View Post
Do you have at least SP2 installed with 2007? Prior to that you needed a separate add-in for exporting to PDF.
Thanks I found a link to PDF Add-in for 2007 Excel.


Download 2007 Microsoft Office Add-in: Microsoft Save as PDF or XPS 12.0.4518.1014 for Windows - Filehippo.com

Last edited by psyclone; 01-04-2023 at 02:40 AM. Reason: added url
Reply With Quote
  #6  
Old 01-05-2023, 04:39 AM
Debaser's Avatar
Debaser Debaser is offline EXCEL 2007 - Create PDF Windows 10 EXCEL 2007 - Create PDF Office 2016
Competent Performer
 
Join Date: Oct 2015
Location: UK
Posts: 221
Debaser will become famous soon enough
Default

You really ought to install the service packs. Prior to SP2, Office 2007 was barely usable.
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to create microsoft Excel 2007 and 2010 File in .xlsx format ipacesetters Excel 1 12-16-2019 05:13 PM
How to create Sparklines in older versions of excel. (Excel 2007 and older) Nicewithit Excel 0 04-18-2018 08:21 PM
EXCEL 2007 - Create PDF Mail merge from excel - need to create sheets and create a table bluenosebex Mail Merge 5 08-02-2015 05:34 PM
Create SVG with PPT 2007? qa1952 PowerPoint 0 07-14-2015 12:24 PM
How to create a resizeable simple checkbox Excel 2007 Imageman100 Excel 1 01-10-2014 11:53 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 12:29 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft