I'm very new to Excel and I have a problem I'm struggling with in VB. I have a document object variable that references a Word document that is generated in VB script which has text added to it dynamically etc. When I execute a Close (i.e. objDocument.Close) before the document is saved, a message displays asking the user whether they want to save or not. If they choose Save and provide a valid file name and path, the document saves successfully. But if they choose "Cancel", a message box appears displaying "Run-time error '4198': Command failed".

Does anyone have any idea why this message appears? I'm not sure what I may be doing wrong.

Thanks!