IT SOLUTIONS
Your full service technology partner! 
-Collapse +Expand
Paradox
Search Paradox Group:

Advanced
-Collapse +Expand Paradox To/From
To/FromCODEGuides
-Collapse +Expand Paradox Store
PRESTWOODSTORE

Prestwood eMagazine

October Edition
Subscribe now! It's Free!
Enter your email:

   ► KBDesktop Data...Paradox & Ob...ObjectPAL Co...OPAL: Langua...Paradox Downloads  Print This     
  From the October 2015 Issue of Prestwood eMag
 
Paradox OPAL: Language Details:
Paradox and OpenOffice
 
Posted 12 years ago on 5/17/2009 and updated 10/4/2009
Paradox Code Snippet:
 A flashcard from our Paradox Flashcards Library
 A code snippet from our Paradox Code Snippets Page

KB101996

Download Link:

 Download File Now

Export to OpenOffice

Syntax Example:
method openWorkBook(var Excel OleAuto, fileName string) logical
var
 StarDesktop,StarOffice  OLEAuto
 oooDoc,scr,lists,list,zak OleAuto
 massiv AnyType
 fs filesystem
 put,s string
 dlin,k,i smallInt
endVar
ShName.BLANK()
ShiNDEX.BLANK()
try
  scr.open("MSScriptControl.ScriptControl")
 scr.language = "javascript";
 scr.eval("aaa=new Array()")
 massiv = scr.eval("aaa")
 scr.AddCode("function SetItem(ind,val){massiv[ind]=val}")
 StarOffice.Open("com.sun.star.ServiceManager")
 StarDesktop=StarOffice.createInstance("com.sun.star.frame.Desktop")
 dlin=fileName.size()
 
 put=""
 k=1
 i=1
 while i<>dlin
  s=fileName.subStr(i,1)

  if ansiCode(s)=92 then 
   put=put+"/"+fileName.subStr(k,i-k)
   k=i+1
  endIf 

  i=i+1
 endWhile
 put=put+"/"+fileName.subStr(k,i-k+1)
 if put.subStr(put.size()-3,4)=".xls" then
 else
  put=put+".xls"
 endif
 Excel=StarDesktop.LoadComponentFromURL("file://"+put,"_blank", 0,massiv)
 return True
onFail errorClear() return False
endTry
endMethod

Download Link:

 Download File Now


Comments

1 Comments.
Share a thought or comment...
Comment 1 of 2

Hi all,

    How can I use the method  :

method openWorkBook(var Excel OleAuto, fileName string) logical     ?

The file name is  something that exists, like "name.ods", but who is "Excel" ?

Thanks.

Posted 12 years ago

Comment 2 of 2

What is your mail? I will send the program. runlir at gmail dot com.

Posted 12 years ago
 
Write a Comment...
...
Sign in...

If you are a member, Sign In. Or, you can Create a Free account now.


Anonymous Post (text-only, no HTML):

Enter your name and security key.

Your Name:
Security key = P1182A1
Enter key:
Code Contributed By runlir:
Visit Profile

 KB Article #101996 Counter
12541
Since 5/17/2009
Go ahead!   Use Us! Call: 916-726-5675  Or visit our new sales site: 
www.prestwood.com


©1995-2021 Prestwood IT Solutions.   [Security & Privacy]