Web Page On VPS Can't Create Word Application ActiveX Object
Nov 7, 2012
So I have written as part of an application some code that on my clients website pulls some information from SQL server and uses it to create a new file using a Word with bookmarks as a template. It works fine on my development machine, but not on my production server with the error: "Cannot create ActiveX component.: Word.Application". Now I have been approaching this as if it is an issue with Office, but it occurred to me that this might be another issue. Maybe some security issue with ASP.NET? My original thought was it was some kind of compatibly problem as I had Office 2007 on my machine and 2010 on the server.
Code:
Protected Sub btnCreate_Click(sender As Object, e As System.EventArgs) Handles btnCreate.Click
Dim objWord As Object
Dim objDoc As Object
Dim strContractFile As String = "~Documents" & txtContractFile.Text
Dim strContractFilePath As String = Server.MapPath(strContractFile)
[Code] .....
View 5 Replies
Similar Messages:
Mar 3, 2010
My name is Christian, I developed a web application in VB.NET 2005 that calls a Microsoft Word Application, it works fine in my develop's machine but when I put all of the code in production's server I received the following error:System Error: Cannot create activex component. following I put the code. If somebody knows how to solve this,
Dim oWord As Microsoft.Office.Interop.Word.ApplicationDim oDoc
As Microsoft.Office.Interop.Word.DocumentDim oTable
As Microsoft.Office.Interop.Word.TableDim oPara0
As Microsoft.Office.Interop.Word.ParagraphDim oPara1
As Microsoft.Office.Interop.Word.ParagraphDim oPara2
As Microsoft.Office.Interop.Word.ParagraphDim oPara3
As Microsoft.Office.Interop.Word.Paragraph, oPara4
As Microsoft.Office.Interop.Word.Paragraph
oWord = CreateObject("Word.Application")
oWord.Visible = True
oDoc = oWord.Documents.Add
oPara0 = oDoc.Content.Paragraphs.Add
oPara0.Range.Text = "Hola"
oPara0.Range.InsertParagraphAfter()
View 6 Replies
Feb 28, 2011
How to create and open a docx in client side's Word from asp.net application? and if i want the user to customize the document at their localend, then how can i do this?
View 1 Replies
Jul 13, 2010
I have to implement broker and dealer socket connection like in share market i.e. it should connect at 9 AM and stop at 3.30 PM and repeat in next morning ...
so following is my requirement
1) i have to create application object once in day at 9 AM and destroyed at particular end day 3.30 PM.
My question is how to destroyed application object at given particular time ... i think this can be done in application_end handler in global.asax ... but my question is when no request is made at that time then what happened..
View 2 Replies
Jul 30, 2010
Currently I have written the Activex Control for RFID USB reader and calling that one in ASP.NET web application. The Activex Control is working fine when I will give the full trust permission for particular IIS URL in
1. Open Control Panel > Administrative Tools > .NET Framework 2.0 Configuration
2. Expand Runtime Security Policy > Machine > Code Groups > All_Code
3. Right Click All_Code and click New...
4. Create a new code group, I named mine MyProject_FullTrust_Zone
5. Choose the URL condition type and specify the path on the network where the apps will be deployed.
6. Choose Use Existing permission set, and set it to Full Trust.
Alternative way of giving permission for an Activex Control is
1. Open Visual Studio Command Prompt
2. Run the command caspol -machine -addgroup 1. -site <ip address> FullTrust Doing this it works fine.
Whenever my web site will open, it will ask the user to give permission for the Activex Control using Allow or Cancel Button in browser. This type of functionality I have seen some web site which takes input from the user to allow the ActiveX Control.
View 1 Replies
Jul 5, 2010
I have requirement where I need to allow users to upload a Word document with place holders for certain fields which can be found in the database. This will be their template. For example the place holders might be prepended with @@ or something. For example
Dear @@Title @@Lastname
They then can grab a record and hit export to Word document. This will then let them choose the template. They can select the template and then click continue. I will then get the template and replace the @@Title with the title field in the database for the selected record. I am not sure where to start or what components I need to do this.
From my initial investigation it seems that I can do this with the new open XML standard for Office 2007. So perhaps I should read in the template and save all the contents to a db table somewhere. Then when the use wants to export I get the contents again and then do a search and replace for the @@ placeholders and link them properly. Then save the document to the output stream again which will then bring up the save dialog on their browser.
I am using ASP.Net MVC and am in a hosted environment. I was also maybe contemplating dynamically creating a new View type and dynamically creating new views when the user uploads a template. Not sure that this approach will work though.
View 2 Replies
Apr 28, 2010
I have been working on an asp.net web application that calls a third party COM application through createObject method. The application works fine (gets initialized) in Win XP but I am having problems getting it to work in WIndows 2003. I get the "Cannot create ActiveX component" error.
The website works fine in visual studio - the application launches fine. The references added were the interop assemblies which were packed inside a tlb file.
I am aware of the change in default user - ASPNET for iis 5 and Network Service for IIS 6.0. Also I have changed the default permission levels in DCOM config for not just this COM application but all the COM applications by changing the default COM security properties of the computer. I gave almost every user the permissionto launch and access remotely including Network service and everyone.
The other thing I have done was to test it out in IIS 5.0 isolation mode but couldn't get the application work - still same error.
The final thing I have tried was to use IIS 6.0 itself but change the application pool to local system and I am just stumped that even this didn't resolve the error.
Another thing to add is that I cannot register the tlb file using regsvr32.exe command as it is not a dll.
View 4 Replies
Aug 13, 2010
I have developed a website that allows users to upload office documents then uses the office object model to convert the document to an HTML file that it then displays in an iFrame. I have, of course, included references to Office.interop.word, and the site works fine on my development machine. When I uploaded it to my production server the site functions fine until I try to upload a document. I initially got a similar error that said "COM object not registered". I realized that Word wasn't installed on my production server. So I installed word and now when the server tries to access the word object model I receive the following error:
Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the following error: 80070005 Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
I searched the registry for the corresponding CLSID and found a corresponding folder. I added full control to the IUSR_ account and due to the persistence of the error I eventually added full control to "everyone" and ensured these permissions inherited down to the rest of the folder. I then added full control to IUSR_ and again eventually added full control to "everyone" to my microsoft office folder. I don't know what other permissions to grant and where in order to make this "Access is denied" error go away. I must be granting them in the wrong place, because as far as I know I can't be any more permissive than "Everyone" "Full Control".
View 1 Replies
Jan 19, 2010
try to create a activex. if i use printdocument class it will throw security exception on client side. how to assign print permission for a assembly?
View 1 Replies
Sep 16, 2010
I have spent last couple of days on this subject but no luck :)
I want to achive following using VS2008/C# -
1. create a cab file using existing AciveX/ocx control,
2. use the ActiveX on ASP.NET WebForm.
3. deploy the app and cab file on web server
4. Test/verify that the cab file get downloaded, and IE can use my ActiveX/ocx
I found one nice tutorial on this but it is with VB.Net (not VS2008) -
[URL] (the problem I get with VS2008 - can's see Authenticode Signing check box, or add ActiveX to Toolbox).
View 3 Replies
Jan 7, 2011
I've been tasked to update and install a new version of an old ActiveX control in our Aspx web application .The actual updating is fairly straightforward, but the installing is giving me headaches. Here is what I tried:
In the VB6 editor, get the properties of the ActiveX project, and check off the "autoincrement" checkbox in the "Make" tab.Set the version to 1.0.12 Create a new CAB with the Package&Deployment wizard. Copy this CAB to my website.
Then in the Aspx itself, I update the version of the activeX as follows:
Me.Page.Header.Controls.Add(New LiteralControl(String.Format("<div style=DISPLAY:none'><object id='PrtLabel' codebase='{0}' classid='CLSID:AB61148E-D4B5-4D4B-8867-9E4CE8229B5E' viewastext></object></div>", "PrtLabel.CAB#version=1,0,0,12")))
After this, I delete the prtlabel.dll and prtlabel.inf files from the "c:windowsdownloaded program files" folder.
Problem is, when I then visit the web page and it asks me to install the activeX, it doesn't actually do it (no error message appears though). When I go back to the "c:windowsdownloaded program files" folder, ONLY the prtlabel.inf file has been copied there, NOT the prtlabel.dll file.
Is there a special procedure to put a new version of an ActiveX control in your website?
View 2 Replies
Dec 23, 2010
I need a multiple file uploader dialog,that means I can able to select multiple files at a time in file upload window.How can I achieve this task? I gone through Google and I came to know that we can achieve this using silverlight and flash plugins,but these are not recomandable in my application. Is there any open source(i.e free) ActiveX controls for Multi file Uploader? Is it possible to create own ActiveX control to achieve this task.
View 4 Replies
Jan 20, 2015
I'm new to ASP.NET. I'm making a session counter, which is incremented in the Session_Start() event and decremented in Session_End(). I have created a Global.asax file and added the event handlers. Then I wanted to access the Application object in a .cshtml file, but the Application object is not available. It's underlined with a red squiggly line.
View 2 Replies
May 12, 2010
<object id="Bacs_DBTableRepX"
classid="CLSID:CA8B72B3-3B15-40D7-9364-478E25AF5B41"
codebase="Bacs_DBTableRepX.cab"
[code]...
View 1 Replies
Feb 3, 2010
I want to integrate a ActiveX control into asp.net page, I wonder if Firfox can support ActiveX control or not?
View 1 Replies
Mar 28, 2010
in my Asp.net web page (C# on backend) I use a Repeater, whose items consist of a title and a Flex chart (embedded .swf file). I am trying to export the contents of the Repeater to a Word document. My problem is to convert the SWF files into images and pass it on to the Word document.
The swf object has a public function which returns a byteArray representation of itself (public function grabScreen():ByteArray), but I do not know how to call it directly from c#. I have access to the mxml files, so I can make modifications to the swf files, if needed.
[Code]....
View 1 Replies
Oct 18, 2010
i have 2 stringbuilder object. now i want to compare these 2 objects and have to find what is the different word from object to object2. how to do this?
View 1 Replies
Feb 9, 2011
I am trying to use aspx pages as an email templates. There will likely be a bunch of objects on the page which will be used as replacements in the html. Because it's an aspx page I'll be able to use databinding, repeaters, etc. At run time, I want to be able to instantiate the aspx page from its path, pass in a bunch of properties, and then get the rendered result of the page and email it. This seems pretty straightforward from a asp.net website (maybe using BuildManager or Server.Execute.) However, I want to be able to use the same templates via a console application by just loading up a page object from its filepath. Is this possible?
View 1 Replies
Feb 1, 2010
I think the title says it all, I have an activeX control, that ask the user if he want's to install it every single time the page loads (Even if it is already installed). Can anyone point me in the right direction? What I have tried so far:
Setting new Guids for the class & interface.
Changing interfaces names & method names.
Changing version number
Uninstalling and re-installing the activeX
View 2 Replies
Feb 25, 2011
I am writing a program that uses a .dotx template and does a merge of data in an aspx page. The program works perfect on my Dev workstation locally but when I deploy it to a test IIS server, it fails on the second line below giving me an Object Reference error.
I ran into problems earlier because the Word Com object was not on the IIS server so I loaded Word onto the server and set permission in DCom and got past that problem. But now I get this error on the line that starts with wRange = . As I said, the program works perfectly locally in debug mode.
Microsoft.Office.Interop.Word.DocumentClass
System.NullReferenceException: Object reference not set to an instance of an object
lines of code:
Document BaseDocument = oWord.Documents.Open(ref oTemplate, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing);
wRange = BaseDocument.Bookmarks.get_Item(ref endOfDoc).Range;
View 2 Replies
Oct 29, 2010
I have a control in a 'window control library' which handles - 'drag and drop' files from computer to a listbox control, I then reference this .dll in .aspx (See code below). Now, when i try to access this through webserver for drag
and drop files i get following errror - The type of the first permission that failed was : System.Security.Permission.FileIOPermission.
How do I handle this, so that drag and drop of files can happen over the webpage residing at webserver.
namespace testWinControl1
View 1 Replies
Jul 31, 2010
I used Object Test Bench to test my classes in VS 2008 professional edition . Right click on Class name and then selected create instance ,then its Constructor, there comes a dialog box, that just gives a message and a TextBox field is present there, i filled that field with any name and clicked OK.Then error message comes that "Create Instance Failed" and its error code is "0x80004005" . What's this ? How to instantiate object of my classes ?
View 4 Replies
Jul 17, 2010
I am trying to run the 15 minutes movies MVC application but I got the following error:
Object reference not set to an instance of an object.
Description:
An unhandled exception occurred during the execution of the current web request. review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
[Code]....
View 1 Replies
Jun 9, 2010
I have to generate reports in both ms-word and pdf format....i have it working in pdf w/ iTextSharp. With iTextSharp, I create a new FileStreamResult for the MVC Action to return .How can I create a word document and have the user download it when an action is invoked?
[Code]....
View 6 Replies
Feb 21, 2010
I develop web pages in Visual Studio 2005 in Visual Basic. I want to create reports in MS Word (text and several Tables also). How can do it.
View 1 Replies