![]() |
|
#1
|
|||
|
|||
![]()
I love your macro, I have been trying to do this for years on a huge Word document. And it worked great the first three times I used it. But the next day, the ExportAsFixedFormat fails with a read-only error. Running attrib from cmd.exe shows only the archive attribute set.
If I use ActiveDocument.SaveAs FileFormat:=wdFormatPDF (which does not let me select the PDF parameters, so it is unacceptable), the command fails and the VBA error dialog simply states that the command failed. If I test for the existence of the file and try to delete it, the delete command fails and the VBA error dialog shows a permissions error. I rebooted the computer to ensure no process had it locked. The Word document, macro, and PDF all exist in the same user account. When I do a File > Save As > PDF, Word prompts me to overwrite and then successfully writes the PDF. I also encountered an odd problem with this macro. If I import the macro into a macro-free file, .docx, and run the macro, it works fine. If I save the document as a macro-enabled file, .docm, and run the macro, it fails. Even more interesting: I deleted the PDF from the directory before I ran the macro and I still received the error "Run-time error '-2147467259 (80004005)': This file is read-only." I have no clue what file it thinks is read-only. |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Bookmarks | Schildkröte | Word VBA | 8 | 06-28-2015 11:13 AM |
![]() |
PeterPlys | Word VBA | 13 | 01-14-2015 06:41 AM |
Can't See Bookmarks | bobmayo | Word | 21 | 06-04-2013 07:37 AM |
![]() |
samanthab | Word | 3 | 01-19-2013 06:27 AM |
![]() |
Dom37 | Word VBA | 2 | 10-31-2011 03:28 AM |