Problems with Word2000 and Vista

S

SteM

Hi all,
since i installled Vista I started to have problems running Word2000 from
VBA Access.
In any case I noted a difference between Winword2000 and other Office
programs:
on the normal launch Word shows a window for 'user account control', Cancel,
Allow (or something like that, mine is not in english).
Running Excel, powerpoint and other, not.

I need to run Word2000 from a vba macro in Access2000: no problem with XP or
Win2000.
If i call a 'new Word.Application' or 'Shell("c:\...\winword.exe')' i have
the error:
Function call or argument not valid
or
Automation Error
To execute the requested operation is needed a higher rights.

If i change for 'calc' or 'notepad' there are no problems.

If I put Word in other folder (ex. c:\tmp\winword.exe) Shell() is able to
run it but hen i need to get the variable to control the program:
if I call GetObject(,"Word.Application") I get l'error 13.

What happens ???
How can i solve?
Any idea?
 
G

Guest

Perhaps someone set it's compatability options to Always Run As An
Administrator on winword.exe's compatability tab on its property sheet.
 
S

SteM

Yes :(
There was the checkbox checked !!
Now I have no more problems on lauch Winword by Shell(...) but the other
problems on automation are still there ...

Thanks !



Perhaps someone set it's compatability options to Always Run As An
Administrator on winword.exe's compatability tab on its property sheet.
 
G

Guest

Try typing

winword /reg

and also

In Word 2000 choose Repair Word from the Help menu
--
..
--
SteM said:
Yes :(
There was the checkbox checked !!
Now I have no more problems on lauch Winword by Shell(...) but the other
problems on automation are still there ...

Thanks !
 
G

Guest

Try typing

winword /reg

and also

In Word 2000 choose Repair Word from the Help menu
--
..
--
SteM said:
Yes :(
There was the checkbox checked !!
Now I have no more problems on lauch Winword by Shell(...) but the other
problems on automation are still there ...

Thanks !
 
G

Guest

When using automation winword is started with the following command line
winword /a
which starts word without addins or customisations.
 
S

SteM

Thanks,
i run them but without success.

I noted that, even if they return error, both CreateObject() and new
Word.Application run an invisibile Word instance !!
I see them between the processes !
But CreateObject() returns error13, new returns error 430.

???
 
G

Guest

Make the object visible. If visible it won't close automatically when your program exits (you have to explicitly close word). That is COM/Automation rules.

13 means
Type mismatch (Error 13)
Visual Basic is able to convert and coerce many values to accomplish data type assignments that weren't possible in earlier versions. However, this error can still occur and has the following causes and solutions:

a.. The variable or property isn't of the correct type. For example, a variable that requires an integer value can't accept a string value unless the whole string can be recognized as an integer.
Try to make assignments only between compatible data types. For example, an Integer can always be assigned to a Long, a Single can always be assigned to a Double, and any type (except a user-defined type) can be assigned to a Variant.

b.. An object was passed to a procedure that is expecting a single property or value.
Pass the appropriate single property or call a method appropriate to the object.

c.. A module or project name was used where an expression was expected, for example:
Debug.Print MyModule
Specify an expression that can be displayed.

d.. You attempted to mix traditional Basic error handling with Variant values having the Error subtype (10, vbError), for example:
Error CVErr(n)
To regenerate an error, you must map it to an intrinsic Visual Basic or a user-defined error, and then generate that error.

e.. A CVErr value can't be converted to Date. For example:
MyVar = CDate(CVErr(9))
Use a Select Case statement or some similar construct to map the return of CVErr to such a value.

f.. At run time, this error typically indicates that a Variant used in an expression has an incorrect subtype, or a Variant containing an array appears in a Print # statement.
To print arrays, create a loop that displays each element individually.

For additional information, select the item in question and press F1.





Class doesn't support Automation (Error 430)


Not all objects expose an Automation interface. This error has the following cause and solution:

The class you specified in the GetObject or CreateObject function call was found, but has not exposed a programmability interface.
You can't write code to control an object's behavior unless it has been exposed for Automation. Check the documentation of the application that created the object for limitations on the use of Automation with this class of object.

You changed a project from .dll to .exe, or vice versa. If, for example, you have a .dll server already compiled and registered, and then you change the project type to .exe and recompile it, the fact that the .dll and .exe are already registered on your system prevents you from creating either object. You must manually unregister the old .dll or ..exe to avoid the problem.
This is caused by the combination of project compatibility and changing a project from an .exe to a .dll. In project compatibility, the CLSID is preserved, but not the IID. Since the CLSID is preserved, the class ends up being registered with two servers—one an in-process server, the other a local server. When an instance is created, the in-process one is chosen. When the querying of the interface occurs, the .dll does not support the IID because it's new.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top