Saving files from Navision

During a posting routine, I would like to let the user save a report as HTML when a posting routine is done. Is there a way to show a Save As dialog box using strictly Navision? I can get it to work using the Common Dialog AxtiveX control, but I can’t tell whether they clicked Cancel or not, and handle the error that generates. Is there some way to handle errors that occur from using custom controls? Regards, Mark

Hi, I use SaveAs dialog from Microsoft Exel. You can Create MS Exel Automation Variable and Run Open or Save dialog. This dialog returns file name when user select a file. Valentin Gvozdev BMI Inc.

Thank you. The Common Dialog Control is behaving a little unusually. Do the client computers require Excel installed on the machine? I will still be able to use your solution this time, since all the client computers will have full installs of Office, but I was hoping for a solution that wouldn’t have any requirements besides a standard Navision install. Thanks again. Regards, Mark

Mark, Do you set the CancelError = True for the Common Dialog control? Only then an “error” is generated when the user clicks Cancel (or presses Esc). The error number to look for as return value is 32755 (from the top of my hat). Know this behavior from VB, but haven’t been using this in NF so far. John

I am aware of the CancelError, which I have set to false. Unfortunately, I then have no way of knowing if Cancel was clicked. I used clear(), and everything worked on my system. But when someone used it on a different system, there was an error: Unable to create object. It’s not a Navision licensing issue, and I doubt it’s a Win NT security issue, either. I’m not sure if clear() is the issue, but it initialized the ocx on my system - which allowed me to check for cancel (filename=’’). Any other ideas?

Common Dialog versions different? John