We have a word document with VBA code (Wizard) attached to it.It works fine.
But when we open this documnet by using Aspose then there some error occurs.
(Error: “runtime error 91 object variable or With block variable not set”)
Here I am attaching the document with all required file to run the file and also
Genrated document using Aspose.
Please have a look at it and let us know if you have any solution for this.
Thank you,
Chetan
Ref code :
' Created a object of document file
Dim doc As Document = New
Document("C:\Templates\504 Wizard 2009.1.dotm")
' and open that using aspose doc.save () method
doc.Save( "test.doc", SaveFormat.Doc,
SaveType.OpenInWord, System.Web.HttpContext.Current.Response)// documents opes without error but wizard doesn’t work
doc.IsTemplate = True
doc.Save("test.dotm",
SaveFormat.Doc, SaveType.OpenInWord,
System.Web.HttpContext.Current.Response) //while opening the document
only we have a error.
System.Web.HttpContext.Current.Response.End()
Hi
Thank you for reporting this problem to us. I managed to reproduce the problem on my side. Your request has been linked to the appropriate issue. You will be notified as soon as it is resolved.
Best regards.
Thanks for your reply.
Please let me know if you got any solution on this.
Hi Chetan,
Thanks for your inquiry. Sure, we will let you know once there is some progress with this issue.
Best regards.
Hello,
Can you please let us know solution for this if you have any.
As this is an on priority issue for us.
Thank you,
Hi
Thanks for your inquiry. The only way to work the problem around, I can suggest you at the moment, is using attached template. In this case, the template should be installed on each machine where the output document will be deployed.
https://reference.aspose.com/words/net/aspose.words/document/attachedtemplate/
In this case, you can use the following code:
// Open document
Document doc = new Document(@"C:\Temp\504 Wizard 2009.1.dotm");
// Remove macros from the document.
doc.RemoveMacros();
// Attach template to the document.
doc.AttachedTemplate = @"C:\Temp\504 Wizard 2009.1.dotm";
// Save output document.
doc.Save(@"C:\Temp\out.doc");
I put the template in C:\Temp, you can put in any folder you like.
Hope this helps.
Best regards.
Thank you very much,
We tried with some other ways.
But still this option works best for us.
Thank you once again.
The issues you have found earlier (filed as 16622) have been fixed in this update.
This message was posted using Notification2Forum from Downloads module by aspose.notifier.