473,654 Members | 2,974 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

error using GetObject - "cannot create ActiveX component"

9 New Member
Hi,

I'm trying to do a mail merge from Excel to Word (programaticall y) and I'm having some trouble creating the Word Document Object. This line of code
wordDoc = GetObject("shee t.doc")
keeps returning the error "cannot create ActiveX component" and then the program crashes.
Any help is much appreciated. Thank you.

Larry
Aug 15 '07 #1
2 4067
fplesco
82 New Member
Hi,

I'm trying to do a mail merge from Excel to Word (programaticall y) and I'm having some trouble creating the Word Document Object. This line of code
wordDoc = GetObject("shee t.doc")
keeps returning the error "cannot create ActiveX component" and then the program crashes.
Any help is much appreciated. Thank you.

Larry
Hi -

I think you're doing shortcut here. You have to had word application open first.
wordDoc = GetObject("Word .Application")

if above code raises an error, you have to code
wordDoc = CreateObject("W ord.Application ")

and from here, try to open "sheet.doc"
Aug 16 '07 #2
ironmanlarry
9 New Member
Thank you for the help.

I was actually able to get it to work using the GetObject call. I think it needed the full path of the file to open.
However, when I try to run the program from a C++ program, it doesn't work. Do you know anything about that?

Thanks, Larry

Hi -

I think you're doing shortcut here. You have to had word application open first.
wordDoc = GetObject("Word .Application")

if above code raises an error, you have to code
wordDoc = CreateObject("W ord.Application ")

and from here, try to open "sheet.doc"
Aug 16 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

8
12924
by: Hakan | last post by:
I use the following code to check if a user is an admin in the login page of our intranet. Set User = GetObject("WinNT://" & UserDomain & "/" & UserName & ",user" For Each Group in User.Group Select Case Group.Nam Case "Domain Admins Session("Admin")=Tru Case "Domain Users Session("User")=Tru End Selec
2
5341
by: Berata | last post by:
Hello all, in VB6 we were able to create ActiveX-DLL's (In Process Components) and ActiveX-Exe's (Out of Process Components). We habe build up an application that exists of an main module (Standard Exe) that calls and controls other modules (ActiveX-Exe). We decided for ActiveX-Exe because they run in different processes. That means if one module shuts down, the others are still alive. Second reasons
0
2725
by: Dica | last post by:
i'm just trying out c# and VS 2003 for the first time and i'm running into an error: "Cannot create a child list for field tblProjects" the section of code that seems to be throwing this is: this.sqlDataAdapter1.Fill(dsProjects1, "tblProjects"); cboProjects.DataSource = dsProjects1;
1
4421
by: Mary Kerrigan | last post by:
I'm tearing out my freakin' hair on this one. Trying to deploy an ASP.NET site on a Windows 2000 Advanced Server. The framework v1.0.3705 was already installed, not by me. When I tried to get to a page that accesses data, I get this error, that begins with: "Cannot execute a program. The command being executed was "c:\winnt\microsoft.net\framework\v1.0.3705\vbc.exe"..." I have searched and searched but could find no solution. I...
0
2210
by: Abhi | last post by:
The applicaiton through which the service is created, doesnt give that error. To check the exact issue, I tested with a service containing this block of code. The service gives the error when run as local system or even in an account (mine) For this block of code Private Sub Timer1_Elapsed(ByVal sender As Object, ByVal e
0
1727
by: Tom | last post by:
I have a .net v2 asp.net problem. I develop on my workstation and deploy to a production server. I use compile on demand, so no pre-compile is done. When I deploy, I first must move in my new or changed pages. Then I must restart IIS. After that, everything is good, and I run for weeks without problems. If something should cause a compile ( like making a change to one of the pages and then requesting the page), the following error will...
2
2186
by: qazmlp1209 | last post by:
class base { public: base() { } base(int number) { priNumber = number ;
2
5038
by: mirin | last post by:
Hi Folks, I'm using .NET framework 2.0 My code errors out on the below line: objRootDSE = GetObject("LDAP://rootDSE") The error message is "Cannot create ActiveX component". The same code works fine in my development Win2000 PC where I'm using
4
2968
by: Waldy | last post by:
Hi there, does anyone know the cause of this problem. When I press F5 to debug a C# web application, I get an error message that begins "Cannot create/shadow copy " then various different file names. Sometimes I can debug, other times I get the message above. Regards, Steve W.
0
8375
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8290
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8707
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8593
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7306
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5622
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2714
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1916
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1593
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.