Jump to content

object creation !


Recommended Posts

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.

Link to comment
Share on other sites

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

Link to comment
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.

 

Link to comment
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

Link to comment
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

Link to comment
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

Link to comment
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.

 

Link to comment
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

Link to comment
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.

 

Link to comment
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?

Link to comment
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

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.

 

Link to comment
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 :
Link to comment
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.

 

Link to comment
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

Link to comment
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.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...