0

I want to open a save as dialog for the user via VBA. I found this method:

   Application.Dialogs(xlDialogSaveAs).Show ("c:\my_folder\")

from this previous question save as dialog excel code

Obviously, it does not work in Visio. What is the corresponding Argument for Visio? Cant seem to find a list of all possible options online.

Another possibility I found is

Application.GetSaveAsFilename

but that does not work in Visio either!

Thanks for any hints!

5
  • 1
    You should be able to find plenty of examples online with a simple Google search. 'se the SaveAs method to save a document for the first time. ThisDocument.SaveAs "path\filename.vsd" or Me.Application.ActiveDocument.SaveAs(docPath) or save as new path Me.Application.ActiveDocument.SaveAsEx(newDocPath Commented Jul 16, 2018 at 17:46
  • Thanks for the input! I cant test your code immediately but I think this lets me save the file to a given path. I want however, the User to be able to choose the file! Just as if one clicked the "Save as" button. Sorry if I wasnt clear above. Commented Jul 16, 2018 at 17:53
  • 1
    Not an answer as such, but you can search in the Object Browser (that little box with the shapes coming out from it on the VBA editor tool bar) for "SaveAs". Commented Jul 17, 2018 at 7:08
  • 1
    Ahh - okay - yes if you want to use the Win API method you can use Ken Getz's plug and play module from access.mvps.org/Access/api/api0001.htm and just call it likestrSaveFileName = ahtCommonFileOpenSave( OpenFile:=False, Filter:=strFilter, Flags:=ahtOFN_OVERWRITEPROMPT Or ahtOFN_READONLY) Commented Jul 18, 2018 at 3:11
  • Duplicate of: stackoverflow.com/questions/33762039/…. Voted to close. Commented Jul 22, 2018 at 8:04

1 Answer 1

2

MS Visio VBA object model haven't own build-in dialog box collection for save documents.
You can add MS Excel library in references of your VBA-project. Tools -> References enter image description here Press button Browse and find MS Excel library enter image description here Look also this list XlBuiltInDialog Enumeration (Excel)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.