[jawsscripts] Re: using com objects in jaws scripting and excel

  • From: Chad Foster <chad.foster@xxxxxxxxxx>
  • To: jawsscripts@xxxxxxxxxxxxx
  • Date: Mon, 28 Sep 2009 14:03:23 -0400

1. No, you cannot. You will have to use the wrapper function or define
your own global variable and assign it to the wrapper function's
output.
2. Using the wrapper function enables you to use the built-in Freedom
Scientific function without worrying about it being properly
documented in the associated documentation (JSD) file. The binary file
(JSB) and documentation file (JSD) are not always synchronized.

-C

On 9/28/09, Marlon Brandão de Sousa <splyt.lists@xxxxxxxxx> wrote:
> Hello Xad,
> Two questions:
> 1- in the module xlFunc.jsb there is an autostartEvent that makes a
> global object called oExcel available and initialized to the default
> excel application object, accordingly with the documentation in
> xlFunc.jsd.
> I tried to use the oExcel object from within the microsoft excel.jss
> but werent able to do so * the compiler complained about a not defined
> oExcel variable. So .. can't I use a global variable defined in a jsb
> module from outside it even if the current module has a use statement
> ponting to the module where this global variable is defined?
>
> 2- What would be the advantages of using a wrapper function such as
> this one you suggested?
>
> Thanks,
> Marlon
>
> 2009/9/28, Chad Foster <chad.foster@xxxxxxxxxx>:
>> Yes, it should. You may want to write a wrapper function for the
>> GetExcelObject function though. Like:
>>
>> Object Function GetExcelObject ()
>> return GetExcelObject ()
>> endFunction
>>
>>
>> On 9/28/09, Marlon Brandão de Sousa <splyt.lists@xxxxxxxxx> wrote:
>>> Hello,
>>> I will report soon a set of scripts that I have developped to enhance
>>> excel usability. I have found several functions compiled in the
>>> xlFunc.jsb module. These functions don't appear in the insert function
>>> dialog although the microsoft excel.jss has a use "xlFunc.jsb"
>>> statement.
>>> I then looked into the JAWS shared settings and found a file
>>> xlFunc.jsd from where I got the function specs for this module and
>>> have cinse then make a extensive use of that stuff.
>>> For now, my question is the following:
>>> JAWS 9 has a function called moveToCell in the xlFunc.jsb module and I
>>> am using this function. Unfortunately JAWS 6 doesn't have this
>>> function available, so I need to build a similar function, cinse I
>>> need to support JAWS 6.
>>> I developped the following similar function:
>>>
>>> function focusCell(string sCoordinates)
>>> var
>>> object oExcelTable,
>>> object oNull
>>> let oexcelTable = getObject("excel.application")
>>> if(!oExcelTable)
>>> saystring("can not get the excel application object")
>>> return
>>> endIf
>>> ;move to a1 cell of the current worksheet
>>> excelTable.range("a1").select()
>>> let oExcelTable = oNull
>>> endFunction
>>>
>>> This code compiles and runs wonderfully on JAWS 9 (called by a script)
>>> but wont run in JAWS 6 where I need it, although it compiles and
>>> passes the test of checking if oExcelTable was created. Why? If a call
>>> to a com function works in JAWS 9, it should work in every other
>>> version that support com automation rigt?
>>>
>>> Thanks,
>>> Marlon
>>>
>>> --
>>> When you say "I wrote a program that crashed Windows," people just
>>> stare at you blankly and say "Hey, I got those with the system, for
>>> free."
>>> Linus Torvalds
>>> __________
>>> Visit and contribute to The JAWS Script Repository http://jawsscripts.com
>>>
>>> View the list's information and change your settings at
>>> //www.freelists.org/list/jawsscripts
>>>
>>>
>>
>>
>> --
>> Chad Foster
>> Access Technology Solutions
>> Leveling The Playing Field Through Technology
>> http://www.GO-ATS.net
>> __________
>> Visit and contribute to The JAWS Script Repository http://jawsscripts.com
>>
>> View the list's information and change your settings at
>> //www.freelists.org/list/jawsscripts
>>
>>
>
>
> --
> When you say "I wrote a program that crashed Windows," people just
> stare at you blankly and say "Hey, I got those with the system, for
> free."
> Linus Torvalds
> __________
> Visit and contribute to The JAWS Script Repository http://jawsscripts.com
>
> View the list's information and change your settings at
> //www.freelists.org/list/jawsscripts
>
>


-- 
Chad Foster
Access Technology Solutions
Leveling The Playing Field Through Technology
http://www.GO-ATS.net
__________ 
Visit and contribute to The JAWS Script Repository http://jawsscripts.com

View the list's information and change your settings at 
//www.freelists.org/list/jawsscripts

Other related posts: