Sign in to follow this  
Followers 0
neotrio

object creation !

29 posts in this topic

Hi all,

Im trying obj/com reference functions but im getting error unknown function,e.g.:-

ObjCreate(),ObjEvent() etc.Im just running the example script given in autoit(beta) help.

Do I need any specific file to include.

Also,my whole intention is to read data from excel sheet to word document and vice-versa through autoit.

If anybody knows the solution please reply.

Reply asap.

ciao.

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

HI,

you have to beta run or toggle to beta.

In S&S forum there is a excel_UDF which might be quite useful for you.

For testing whether you started your script in beta mode, put this at first in your script.

If @AutoItVersion > "3.1.1.0" Then 
    MsgBox(64, "Info", "Script " & @ScriptName & " started in BETA mode!" & @CRLF & "Version : " & @AutoItVersion)
ElseIf @AutoItVersion = "3.1.1.0" Then 
    MsgBox(64, "Info", "Script " & @ScriptName & " started in normal mode!" & @CRLF & "Version : " & @AutoItVersion)
EndIf

So long,

Mega

Edited by th.meger

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites

Need to make sure your running it in Beta

if you don't have it a good tool to use is SciTE (see my sig for link)

With-in site Alt+F5 to run using beta or Tools/Beta Run

Gary


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

hi th.meger,

Its not working !

HI,

you have to beta run or toggle to beta.

In S&S forum there is a excel_UDF which might be quite useful for you.

For testing whether you started your script in beta mode, put this at first in your script.

If @AutoItVersion > "3.1.1.0" Then 
    MsgBox(64, "Info", "Script " & @ScriptName & " started in BETA mode!" & @CRLF & "Version : " & @AutoItVersion)
ElseIf @AutoItVersion = "3.1.1.0" Then 
    MsgBox(64, "Info", "Script " & @ScriptName & " started in normal mode!" & @CRLF & "Version : " & @AutoItVersion)
EndIf

So long,

Mega

Share this post


Link to post
Share on other sites

Might help to specify what is not working.

Im runninng it in beta mode, but its not working.

Share this post


Link to post
Share on other sites

Im runninng it in beta mode, but its not working.

hard to help with-out a script to look at and exact errors


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

HI,

I love these posts.

DOESN'T WORK!!! :D:wacko::D

Please you us the whole script you tried and if possible show the error message. Use Scite as editor if you aren't used to another one.

So long,

Mega


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites

hard to help with-out a script to look at and exact errors

script as follows :-

; Example 1

;

; Counting the number of open shell windows

$oShell = ObjCreate("shell.application") ; Get the Windows Shell Object

$oShellWindows=$oShell.windows ; Get the collection of open shell Windows

if Isobj($oShellWindows) then

$string="" ; String for displaying purposes

for $Window in $oShellWindows ; Count all existing shell windows

$String = $String & $window.LocationName & @CRLF

next

Msgbox(0,"Shell Windows","You have the following shell windows:" & @CRLF & @CRLF & $String);

endif

exit

Share this post


Link to post
Share on other sites

script as follows :-

; Example 1

;

; Counting the number of open shell windows

$oShell = ObjCreate("shell.application") ; Get the Windows Shell Object

$oShellWindows=$oShell.windows ; Get the collection of open shell Windows

if Isobj($oShellWindows) then

$string="" ; String for displaying purposes

for $Window in $oShellWindows ; Count all existing shell windows

$String = $String & $window.LocationName & @CRLF

next

Msgbox(0,"Shell Windows","You have the following shell windows:" & @CRLF & @CRLF & $String);

endif

exit

Works for me with no problems.


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

script as follows :-

; Example 1

;

; Counting the number of open shell windows

$oShell = ObjCreate("shell.application") ; Get the Windows Shell Object

$oShellWindows=$oShell.windows ; Get the collection of open shell Windows

if Isobj($oShellWindows) then

$string="" ; String for displaying purposes

for $Window in $oShellWindows ; Count all existing shell windows

$String = $String & $window.LocationName & @CRLF

next

Msgbox(0,"Shell Windows","You have the following shell windows:" & @CRLF & @CRLF & $String);

endif

exit

the error :

\ObjCreate.au3 (11) : ==> Unknown function name.:

$oShell = ObjCreate("shell.application") ; Get the Windows Shell Object

$oShell = ^ ERROR

Share this post


Link to post
Share on other sites

the error :

\ObjCreate.au3 (11) : ==> Unknown function name.:

$oShell = ObjCreate("shell.application") ; Get the Windows Shell Object

$oShell = ^ ERROR

I would suggest downloading SciTE if you haven't already and run the script using Alt+F5 or Tools/Beta Run and see if you have the same problem.

The above error tells me your not running it in beta.


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

I would suggest downloading SciTE if you haven't already and run the script using Alt+F5 or Tools/Beta Run and see if you have the same problem.

The above error tells me your not running it in beta.

ERROR :

C:\Program Files\AutoIt3\beta\Examples\Helpfile\O.au3 (5) : ==> Unknown function name.:

$oShell = ObjCreate("shell.application") ; Get the Windows Shell Object

$oShell = ^ ERROR

Im running it in beta. :D .........

Why im getting this error?

Share this post


Link to post
Share on other sites

#14 ·  Posted (edited)

; Example 1
;
; Counting the number of open shell windows

If @AutoItVersion > "3.1.1.0" Then
    MsgBox(64, "Info", "Script " & @ScriptName & " started in BETA mode!" & @CRLF & "Version : " & @AutoItVersion)
Else
    MsgBox(64, "Info", "Script " & @ScriptName & " started in normal mode! GOODBYE!!!!" & @CRLF & "Version : " & @AutoItVersion)
    Exit
EndIf

$oShell = ObjCreate("shell.application") ; Get the Windows Shell Object
$oShellWindows = $oShell.windows ; Get the collection of open shell Windows

If IsObj($oShellWindows) Then
    
    $string = "" ; String for displaying purposes
    
    For $Window In $oShellWindows ; Count all existing shell windows
        $string = $string & $window.LocationName & @CRLF
    Next
    
    MsgBox(0, "Shell Windows", "You have the following shell windows:" & @CRLF & @CRLF & $string);
    
EndIf
Exit

Edited by gafrost

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

; Example 1
;
; Counting the number of open shell windows

If @AutoItVersion > "3.1.1.0" Then
    MsgBox(64, "Info", "Script " & @ScriptName & " started in BETA mode!" & @CRLF & "Version : " & @AutoItVersion)
Else
    MsgBox(64, "Info", "Script " & @ScriptName & " started in normal mode! GOODBYE!!!!" & @CRLF & "Version : " & @AutoItVersion)
    Exit
EndIf

$oShell = ObjCreate("shell.application") ; Get the Windows Shell Object
$oShellWindows = $oShell.windows ; Get the collection of open shell Windows

If IsObj($oShellWindows) Then
    
    $string = "" ; String for displaying purposes
    
    For $Window In $oShellWindows ; Count all existing shell windows
        $string = $string & $window.LocationName & @CRLF
    Next
    
    MsgBox(0, "Shell Windows", "You have the following shell windows:" & @CRLF & @CRLF & $string);
    
EndIf
Exit
throwing the Same Error :

Share this post


Link to post
Share on other sites

What OS are you using?

windows XP Professional

Share this post


Link to post
Share on other sites

windows XP Professional

when run in release i get the same error as you, apparently running in release doesn't even get to version check

$oShell = ObjCreate("shell.application") ; Get the Windows Shell Object

$oShell = ^ ERROR

So for the last time, are you sure your running it in beta? do you get the message box that says your running it in beta?


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

Hi,

you are so patient Gary. :D

I looks like BIG sorry at the end of this funny thread.

So long,

Mega


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites

when run in release i get the same error as you, apparently running in release doesn't even get to version check

So for the last time, are you sure your running it in beta? do you get the message box that says your running it in beta?

Im doing following step while running the code ;

alt +f7 --for compile(beta)

alt +f5---for run(beta)

but im not getting any message box saying you are running in beta.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0