Firstly I hope that this is the correct forum for this post please forgive if not;
I'm still struggling with ExportAsFixedFormat I have read Ron de Bruin excellent macro but its not working for me.
I need to understand the fundamentals of the command, is it a Mac problem? I understand it works in a windows environment
I have tried the follow code which takes path and file name to make a PDF with the results below:-
Dim Fname As StringDim Fpath As StringFname = "Inv_test.pdf"Fpath = "/users/username/documents/lux/accounts/accounts_15/"If Dir(Fpath) = "" Then MsgBox "Directory does not exist..."End IfMsgBox (Fpath & Fname)If ActiveWorkbook.Saved = False Then ActiveWorkbook.SaveActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, FileName:=Fpath & FnameEnd Sub
The above code generates an message "Error while Printing" and a debug window with an error code 1004.
If I slightly modify the code and change the filename to "test" for example then a file called test.pdf can be found at
The Directory check on first run triggered a permission box which I allowed excel to access the directory as per "Fpath"
So in summary ExportAsFixedFormat is working but not when I try to store the file in the directory I stipulate and or the file name
Many thank in advance