Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 01-19-2014, 08:53 AM
doctor_who12 doctor_who12 is offline Run-time error '1004': Document not saved. The document may be open... Windows 8 Run-time error '1004': Document not saved. The document may be open... Office 2013
Novice
Run-time error '1004': Document not saved. The document may be open...
 
Join Date: Jan 2014
Posts: 1
doctor_who12 is on a distinguished road
Default Run-time error '1004': Document not saved. The document may be open...

Hi,


I am trying to make a macro that exports the current sheet as a PDF as 'invoice [cell value].pdf. I keep trying different things and am getting this error:
Run-time error '1004': Document not saved. The document may be open, or an error may have been encountered when saving.

This is my macro:

Sub Savei()

ActiveSheet.ExportAsFixedFormat _
Type:=xlTypePDF, _
Filename:="C:\invoice" & Range("G3") & ".pdf", _
Quality:=xlQualityStandard, _
IncludeDocProperties:=True, _
OpenAfterPublish:=True

End Sub

Thanks in advance.
Reply With Quote
 

Tags
macro, pdf, save

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Document which always ask to be saved on access? quirky Word 2 12-15-2012 11:32 AM
Run-time error '1004': Document not saved. The document may be open... Run time error 1004 yonasan Excel Programming 3 06-12-2012 11:08 PM
Run-time error '1004': Document not saved. The document may be open... runtime error 1004 gbaker Excel Programming 11 06-06-2012 05:23 AM
Run-time error '1004': Document not saved. The document may be open... Why Word goes to the first page each time we open the document? Jamal NUMAN Word 1 04-14-2011 04:27 AM
Word: The document 'Filename' caused a serious error the last time ... martincruise Word 0 02-25-2010 01:47 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:05 AM.


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