Matt Bracht wrote:
- Create a macro that saves the current sheet only
- Prompts me for a file name to enter, but defaults to the current file sheets file name first
- Default saves to a specified location (if it could allow me to override the location that would be great, but not necessary)
Hi Matt, there are several macros here on the forum that can do all of the above. The only thing required would be to combine them into one macro. So if you can list down the exact requirements I may be able to make the macro for you :
- Create a macro that saves the current sheet only: Does this means current active sheet OR 1st sheet?
- Prompts me for a file name to enter, but defaults to the current file sheets file name first: Which one is required out of these two?
- Default saves to a specified location (if it could allow me to override the location that would be great, but not necessary): Which one is required out of these two?
Good morning Deepak,
Here's the answers to your questions:
- Saves the current active sheet.
- Prompting me for the file name to enter would be more important since I could have multiple sheets under a generic filename for specific configurations.
- Prompting me to choose the file location would also be the best since I may be working on multiple projects that I'd prefer to have the flexibility to sort were these manufacturing files save to.
I'd tried to mend a few of the macro's together that I saw would do portions of what I'm wanting, I just don't have the skill in writing/editing code to actually make the macro function all together.
I appreciate your help.
I don't see the attachments?
Works perfect, thank you!
I have also similar need with this. I need macro to save current sheet of a drawing to a specified folder with the same file name as the drawing.
What do I have to change so that I don't have to enter the file name?
I did get the output folder right by changing:
' Set Save Path
sFilePath = BrowseFolder()
If sFilePath = "" Then
MsgBox "Please select the path and try again"
sFilePath = sFilePath & "\"
' Set Save Path
sFilePath = "C:\PDF\"
Thanks in advance!
sFilename = InputBox(Prompt:="Add File Name Here", Title:="ENTER FILE NAME", Default:="Add File Name Here")
If sFilename = "Add File Name Here" Or sFilename = vbNullString Then
MsgBox "Please Enter File Name first!"
With these lines
sFilename = Mid(swModel.GetPathName, InStrRev(swModel.GetPathName, "\") + 1)
sFilename = Left(sFilename, InStrRev(sFilename, ".") - 1)
Thanks again for the macro.
How to change the macro saving the pdf in the same folder of the drawing.
or how to remove the dialog box "set save path" saving the pdf in the same path.
Try this one... Might not work since I'm on SW2016.
Let me know!
Thanks Kevin I just deleted the "set save path" in the macro.
Its all good.