Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

If you want both the .stp and the .pdf file in the same directory and with the same filename (except for extension), you can still use the result from the first FileDialog you use. You just have to change the extension of the save file, which is fairly easy to do. In your PDF section, instead of

'Set the PDF target file name
oDataMedium.FileName = ExportPath & ExportFilename

use this:

'Set the PDF target file name
oDataMedium.FileName = System.IO.Path.GetFileNameWithoutExtension(dialog.FileName)&".pdf"