Hello,
I have file folder on my desktop:
C:\Users\William\OneDrive\Desktop
I entered this in the Admin sheet in cell L7
How can the code save to this file?
Thank you for your help
![]()
Please Login or Register to view this content.
Hello,
I have file folder on my desktop:
C:\Users\William\OneDrive\Desktop
I entered this in the Admin sheet in cell L7
How can the code save to this file?
Thank you for your help
![]()
Please Login or Register to view this content.
According to your attachment a VBA demonstration for starters :
PHP Code:
Sub Demo1()
Project_Generate
With Projects
.ExportAsFixedFormat 0, [Admin!L7&IF(RIGHT(Admin!L7,1)="\","","\")] & .[F2] & "_Project_" & .[N2], 0, , , , , 1
End With
End Sub
► Do you like it ? ► ► So thanks to click on bottom left star icon « ★ Add Reputation » ! ◄ ◄
Last edited by Marc L; 08-23-2023 at 06:24 AM. Reason: misread ...
I want cell L7 to have the ability to change file location. I should have mentioned that sorry.
I misread, post #2 edited accordingly …
I want to be able to change the file location for the PDF. So can cell L7 have the file location for the code?
If by 'file location' you mean only 'directory' or 'folder' like in your attachment so yes as you can yet see within post #2 …
I ran the code and it created the PDF but did not save to the file specified.
So where ?!
The folder is empty so it seems to not be saving the PDF.
Check at least where the generated pdf file is saved !
Try with a local folder like for example C:\Tests\ whatever if only it already exists …
It is saving in:
C:\Users\William\OneDrive\Desktop
I need to change to:
C:\Users\William\OneDrive\Desktop\Construction
The folder name was missing.
Now it works!
Thank you very much sir.
I have one request please. Is there a way to not have the PDF open but just save to the folder? I do not need to view the PDF.
Last edited by billy60; 08-23-2023 at 07:04 AM.
Why does this go to debug?
![]()
Please Login or Register to view this content.
I had removed the SOLVED tag so that you could get help - you have added it back again. I've removed it once more: if you add it back again before you get a response, don't be surprised if you don't get any further help.
I shall not be intervening with it again.
Ali
Enthusiastic self-taught user of MS Excel who's always learning!
Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.
NB: as a Moderator, I never accept friendship requests.
Forum Rules (updated August 2023): please read them here.
Very sorry to have troubled you. I decided to figure it out on my own this time. Have a nice day.![]()
You haven't troubled me at all.![]()
Okay obviously it has issues.
Can the code you provided not allow the PDF to open just save to file directory?
Did you find at least the obvious missing in your bad filepathname ?
As your initial post code open the pdf file after saving it !
Anyway according to the VBA help - just read it ! - you can just delete , , , , , 1 at the end of .ExportAsFixedFormat codeline …
Thanks once again for your help. No I did not figure out the filepathname issue.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks