This is something I've run into before... if you're in direct control of 
the server (or the host is willing to make the necessary changes) a 
solution is available.  This is what our Sysadmin found after some 
serious searching.  I know that it has guaranteed running on the systems 
we have had problems with before,

HTH
Hatton

Here are the steps to follow:
-----------------------------
1. Log on to the computer as the Administrator and create a new user 
account that will automate Office. In our example, this account is named 
OfficeAutomationUser . Create a password for this user account, and 
select Never expire so that the password does not have to be changed.
2. Add the OfficeAutomationUser account to the Administrators group.
3. Log in to the computer as OfficeAutomationUser and install (or 
reinstall) Office using a complete install. For system robustness it is 
recommended that you copy the contents of the Office CD to a local drive 
and install Office from this location.
4. Start the Office application that you intend to automate. This forces 
the application to register itself.
5. After the application is running, press ALT+F11 to load the Microsoft 
Visual Basic for Applications (VBA) editor. This forces VBA to 
initialize itself.
6. Close the applications, including VBA.
7. On the taskbar, click Start , click Run , and then type DCOMCNFG . 
Select the application that you want to automate. The application names 
are listed below:
    Microsoft Access 97 - Microsoft Access Database
    Microsoft Access 2000/2002 - Microsoft Access Application
    Microsoft Excel 97/2000/2002 - Microsoft Excel Application
    Microsoft Word 97 - Microsoft Word Basic
    Microsoft Word 2000/2002 - Microsoft Word Document

8. Click Properties to open the property dialog box for this application.

9. Click the Security tab. Verify that Use Default Access Permissions 
and Use Default Launch Permissions are selected.
10. Click the Identity tab. Select This User and type the username and 
password for OfficeAutomationUser .
11. Click OK to close the property dialog box and return to the main 
applications list dialog box.
12. In the DCOM Configuration dialog box, click the Default Security tab.
13. Click Edit Defaults for access permissions. Verify that the 
following users are listed in the access permissions, or add the users 
if they are not listed:
SYSTEM
INTERACTIVE
Everyone
Administrators
OfficeAutomationUser
IUSR_<machinename> *
IWAM_<machinename> *

* These accounts only exist if Internet Information Server (IIS) is 
installed on the computer.

14. Make sure that each user is allowed access and click OK .
15. Click Edit Defaults for launch permissions. Verify that the 
following users are listed in the launch permissions, or add the users 
if they are not listed:
SYSTEM
INTERACTIVE
Everyone
Administrators
OfficeAutomationUser
IUSR_<machinename> *
IWAM_<machinename> *

* These accounts only exist if IIS is installed on the computer.

16. Make sure that each user is allowed access and click OK .
17. Click OK to close DCOMCNFG.
18. Start REGEDIT and verify that the following keys and string values 
exist for the Office application that you want to automate:
Microsoft Access 97:
Key: HKEY_CLASSES_ROOT\AppID\MSACCESS.EXE
AppID: {8CC49940-3146-11CF-97A1-00AA00424A9F}

Microsoft Access 2000/2002:
Key: HKEY_CLASSES_ROOT\AppID\MSACCESS.EXE
AppID: {73A4C9C1-D68D-11D0-98BF-00A0C90DC8D9}

Microsoft Excel 97/2000/2002:
Key: HKEY_CLASSES_ROOT\AppID\EXCEL.EXE
AppID: {00020812-0000-0000-C000-000000000046}

Microsoft Word 97/2000/2002:
Key: HKEY_CLASSES_ROOT\AppID\WINWORD.EXE
AppID: {00020906-0000-0000-C000-000000000046}

If these keys do not exist, you can create them by running the following 
.reg file on your system:

REGEDIT4
 
[HKEY_CLASSES_ROOT\AppID\WINWORD.EXE]
"AppID"="{00020906-0000-0000-C000-000000000046}"
 
[HKEY_CLASSES_ROOT\AppID\EXCEL.EXE]
"AppID"="{00020812-0000-0000-C000-000000000046}"
 
[HKEY_CLASSES_ROOT\AppID\MSACCESS.EXE]
"AppID"="{73A4C9C1-D68D-11D0-98BF-00A0C90DC8D9}"
NOTE : The sample .reg file is for Access 2000 or Access 2002. If you 
are using Access 97, change the AppID key to:

"AppID"="{8CC49940-3146-11CF-97A1-00AA00424A9F
}"
------------------------
To avoid registry conflicts, install and run an NT service. Set the 
identity of the service to run as OfficeAutomationUser , and select 
Automatic as the startup type. For more information on creating a sample 
Visual C++ NT Service, see the following Microsoft Developer Network 
(MSDN) Web site:
Creating a Simple Win32 Service in C++
http://msdn.microsoft.com/library/techart/msdn_ntservic.htm

19. Restart the system. This is required.

Kenaz Thomas wrote:

>Hi All,
>
>Iam trying to connect to an Excel file through Cold Fusion 4.5 using COM
>object. I get the following error. Any idea how I can solve this
>
>
>COM error 0x5. Access is denied. 
>
>Thanks in advance
>Kenaz
>
>-------------------------------------------------------------------------
>This email server is running an evaluation copy of the MailShield anti-
>spam software. Please contact your email administrator if you have any
>questions about this message. MailShield product info: www.mailshield.com
>
>-----------------------------------------------
>To post, send email to [EMAIL PROTECTED]
>To subscribe / unsubscribe: http://www.dfwcfug.org
>
>  
>



-------------------------------------------------------------------------
This email server is running an evaluation copy of the MailShield anti-
spam software. Please contact your email administrator if you have any
questions about this message. MailShield product info: www.mailshield.com

-----------------------------------------------
To post, send email to [EMAIL PROTECTED]
To subscribe / unsubscribe: http://www.dfwcfug.org

Reply via email to