Hello Again,
I am trying to save and individual worksheet as PDF on desktop in a new folder. but below script is giving error. It says Run-time error '76': Path not found.
Please Login or Register to view this content.
Hello Again,
I am trying to save and individual worksheet as PDF on desktop in a new folder. but below script is giving error. It says Run-time error '76': Path not found.
Please Login or Register to view this content.
There will be two "\\" backslash characters after Desktop as opposed to just one. I suggest to remove the & "\" after MyFullName = DTAddress...
If you like my contribution click the star icon!
Thanks for our response but problem remain the same.
Please Login or Register to view this content.
What you can do is add a line after the line shown below so you get to see what the actual file name is
Please Login or Register to view this content.
in a message it is displaying a file name not directory name and then file name
So then MyFullName is not initialised properly and you should look at the individual components that should make up the path and name.
Without the actual workbook with the contents I am not able to help you.
Please find the attached sample file.
Observations:
you are trying to create a directory using the statement below, where the variable MyFullName is blank at this time (not initialised)
this is where the error message 'Path not found' comes from. It does not even reach the ExportAsFixedFormat linePlease Login or Register to view this content.
I would also add a file extension to the name as shown in the line below
Please Login or Register to view this content.
still remain the same it says path not found
What value will MyFullName have when you try to create the directory?
it a cell address combination of numeric and string from "ART NRP Flat" worksheet
I have deleted the mkdir statement and added the & ".pdf". Ran the code without any problems.
Maybe the below instruction on your PC does not return any value
check the value in DTAddress by placing a MsgBox DTAddress instruction just below this statement to see the value returned.Please Login or Register to view this content.
Ok post the new copy of the workbook
yes it is converting the sheet into the PDF but i need to make a folder and after converting the sheet into PDF it will be saved in that folder
See post #13, please post a copy of the workbook
i have already attached to my post#7
Yes, but you have made changes to it right?
Please find the sample copy updated
You have removed the statement for creating a directory. The code to create the PDF works, and the pdf gets placed on the desktop.
The example code below creates a new directory named "new_directory_name" on the desktop and because the DTAdress varaible is updated, the pdf will be written into this newly created directory
Please Login or Register to view this content.
Thanks a lot for your help it is working as i want. i will check on my original file it i have any issues i will come back to you. Topic marked as closed and reputation added.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks