Re: [api-dev] Calc and HTML - OOo_3.2.0_Win32

2010-07-27 Thread Rudolf Huber

Hi Niklas,

I will test it the coming weekend.

Anyhow; thanks.

Rudi

- Original Message - 
From: "Niklas Nebel" 

To: 
Sent: Tuesday, July 27, 2010 7:51 PM
Subject: Re: [api-dev] Calc and HTML - OOo_3.2.0_Win32



On 07/25/10 22:05, Rudolf Huber wrote:

In calc I try to run to the following routine:

sCompany = "http://";
sFilter = "HTML (StarCalc)"
sOptions = ""
Table.LinkMode = com.sun.star.sheet.SheetLinkMode.NONE
Table.Link(sCompany, "", sFilter, sOptions, 1)

The routine runs very slow. Is there an option which would speed up the 
process?


It depends on the HTML page you link to. It may contain many images that 
are loaded, or if the table structure is complex, using 
"calc_HTML_WebQuery" instead of "HTML (StarCalc)" may help.


Niklas

-
To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org
For additional commands, e-mail: dev-h...@api.openoffice.org




-
To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org
For additional commands, e-mail: dev-h...@api.openoffice.org



[api-dev] Calc and HTML - OOo_3.2.0_Win32

2010-07-25 Thread Rudolf Huber
Hi,

In calc I try to run to the following routine:

   sCompany = "http://";
   sFilter = "HTML (StarCalc)"
   sOptions = ""
   Table.LinkMode = com.sun.star.sheet.SheetLinkMode.NONE
   Table.Link(sCompany, "", sFilter, sOptions, 1)

The routine runs very slow. Is there an option which would speed up the process?

Thanks in advance.

Regards,

Rudi

   


Re: [api-dev] Calc with two tables

2008-12-14 Thread Rudolf Huber

Hallo Andrew,

thanks again for your kind response. I have to code for each sheet an extra 
definition

between oTabellenListe = oTabellenDokument.getSheets() and Tabelle11 =
oTabellenListe.GetByIndex(0) and thereafter Tabelle31 = 
oTabellenListe.GetByIndex(1).

The additional code looks this:

 If TabellenListe.hasByName("Tabellen1") Then
 oTabellenListe.copyByName("Tabelle1", "Tabelle11", 1) 
Rem for the Copy

 EndIf

 If  TabellenListe.hasByName("Tabellen31") Then
 Tabelle1 = oTabellenListe.getByName("Tabelle31")
 MsgBox "Tabelle31 found"
   else
 Tabelle1 = 
oTabellenDokument.createInstance("com.sun.star.sheet.Spreadsheet")
 oTabellenListe.insertByName("Tabelle31", "Tabelle1") 
Rem for the new sheet

 EndIf

Yesterday, I found the solution after searching the internet again and 
again.


You have to see, I have a problem: I am close to 70 years of age. Therefore, 
it takes a while until I get the point.


I really appreciate help in this matter.

Have I nice week. Thank you again.

Rudi


- Original Message - 
From: "Andrew Douglas Pitonyak" 

To: 
Sent: Saturday, December 13, 2008 2:48 AM
Subject: Re: [api-dev] Calc with two tables





Rudolf Huber wrote:

Halle Andrew,

again thank you for your answer.

I got twice the answer 1 for the printing calls. I interpret this that I
have two sheets, namely sheet 0 and sheet 1.


A count of 1 means that you have one sheet, and the index of the first 
sheet is zero. The point is, if the count is 1, then you can not obtain 
the sheet at index 1.



As long as I had oo0 2.0, I had
no problem. I handled 10 tables in one macro. On the bottom of the sheet,
where I had the sheets-numbers, I always got the correct sheet numbers.
Now, I use ooO 3.0, and I suddenly have problems.


I assume that something else is happening. I noticed some changes with 
respect to how a sheet was loaded, and when a call might return, and what 
the reference to the "loaded" document might be. My mind is vague on this, 
however, and I never gave it much thought, at least not for a while anyway


How long after the document is loaded, do you try to access the sheets? 
what happens if you add a delay?


In our example I declare the sheets-numbers Tabelle11 and Tabelle31. As 
soon
as I call the spreedsheet  I get the sheet-number Tabelle1, which 
apparently

is being generated by ooO. I see all the cells which I had typed when I
created the table. After I call the macro, the routine goes to the point
where I want to call Tabelle31. At that position I get the
outofboundexception. The spreadsheet does not show either Tabelle11 or
Tabelle31. The system acts as if I would have not called either Tabelle11 
or

Tabelle31. Here is the entire code.


Hmm, now that is interesting.

I can not make this code fail.

Can you email me a copy of the referenced document?


Option Explicit

Sub Main

   Dim Desktop As Object
   Dim Platzhalter()
   Dim Url As String
   Dim oTabellenDokument As Object
   Dim oTabellenListe As Object
   Dim Tabelle11 As Object
   Dim Tabelle31 As Object

   Dim EndSpalte As Integer
   Dim EndZeile As Integer
   Dim I As Integer

   Dim Cursor As Object

   Dim ZellenBereich As New com.sun.star.table.CellRangeAddress
   Dim ZellenAdresse As New com.sun.star.table.CellAddress

   ZellenBereich.Sheet = 0
   ZellenBereich.StartColumn = 0
   ZellenBereich.EndColumn = 30
   ZellenBereich.StartRow = 0
   ZellenBereich.EndRow = 300

   ZellenAdresse.Sheet = 0
   ZellenAdresse.Column = 0
   ZellenAdresse.Row = 0

   EndSpalte = ZellenBereich.EndColumn
   EndZeile = ZellenBereich.EndRow



In this next line, you assign to the current document, I would not do that 
without checking the document type and such.



   oTabellenDokument = ThisComponent
   rem oTabellenDokument.LockControllers

   Desktop = CreateUnoService("com.sun.star.frame.Desktop")
   Url = "file:///a:/mist.ods"
   oTabellenDokument = Desktop.loadComponentFromURL(Url, "_blank", 0,
Platzhalter())


What happens if you place a print statement here. Print "hello", for 
example. The only purpose is to give the document time to load.


I assume that the loaded document does NOT call a macro when it starts (or 
anything similar).




   oTabellenListe = oTabellenDokument.getSheets()
   Tabelle11 = oTabellenListe.GetByIndex(0)

   Tabelle31 = oTabellenListe.GetByIndex(1)

End Sub


You question, I I reference the correct document. I run the macro with
break-points.

The only point where I am nor sure of are the LockControllers  and
CurrentController statements. I declared them both, for the cell-area
("Zellenbereich") and the entire document.

I also tried getByName instead of getByIndex. I got the same
outofboundexceptio

Re: [api-dev] Calc with two tables

2008-12-08 Thread Rudolf Huber

Halle Andrew,

again thank you for your answer.

I got twice the answer 1 for the printing calls. I interpret this that I
have two sheets, namely sheet 0 and sheet 1. As long as I had oo0 2.0, I had
no problem. I handled 10 tables in one macro. On the bottom of the sheet,
where I had the sheets-numbers, I always got the correct sheet numbers.
Now, I use ooO 3.0, and I suddenly have problems.

In our example I declare the sheets-numbers Tabelle11 and Tabelle31. As soon
as I call the spreedsheet  I get the sheet-number Tabelle1, which apparently
is being generated by ooO. I see all the cells which I had typed when I
created the table. After I call the macro, the routine goes to the point
where I want to call Tabelle31. At that position I get the
outofboundexception. The spreadsheet does not show either Tabelle11 or
Tabelle31. The system acts as if I would have not called either Tabelle11 or
Tabelle31. Here is the entire code.

Option Explicit

Sub Main

   Dim Desktop As Object
   Dim Platzhalter()
   Dim Url As String
   Dim oTabellenDokument As Object
   Dim oTabellenListe As Object
   Dim Tabelle11 As Object
   Dim Tabelle31 As Object

   Dim EndSpalte As Integer
   Dim EndZeile As Integer
   Dim I As Integer

   Dim Cursor As Object

   Dim ZellenBereich As New com.sun.star.table.CellRangeAddress
   Dim ZellenAdresse As New com.sun.star.table.CellAddress

   ZellenBereich.Sheet = 0
   ZellenBereich.StartColumn = 0
   ZellenBereich.EndColumn = 30
   ZellenBereich.StartRow = 0
   ZellenBereich.EndRow = 300

   ZellenAdresse.Sheet = 0
   ZellenAdresse.Column = 0
   ZellenAdresse.Row = 0

   EndSpalte = ZellenBereich.EndColumn
   EndZeile = ZellenBereich.EndRow

   oTabellenDokument = ThisComponent
   rem oTabellenDokument.LockControllers

   Desktop = CreateUnoService("com.sun.star.frame.Desktop")
   Url = "file:///a:/mist.ods"
   oTabellenDokument = Desktop.loadComponentFromURL(Url, "_blank", 0,
Platzhalter())

   oTabellenListe = oTabellenDokument.getSheets()
   Tabelle11 = oTabellenListe.GetByIndex(0)

   Tabelle31 = oTabellenListe.GetByIndex(1)

End Sub


You question, I I reference the correct document. I run the macro with
break-points.

The only point where I am nor sure of are the LockControllers  and
CurrentController statements. I declared them both, for the cell-area
("Zellenbereich") and the entire document.

I also tried getByName instead of getByIndex. I got the same
outofboundexception..

I really appreciate your help.

Regards,

Rudi



- Original Message - 
From: "Andrew Douglas Pitonyak" <[EMAIL PROTECTED]>

To: 
Sent: Sunday, December 07, 2008 7:36 PM
Subject: Re: [api-dev] Calc with two tables



Rudolf Huber wrote:

Hallo Andrew,


thanks for the prompt answer. Instead of

   Tabelle31 = oTabellenListe.getByIndex(1)

I coded

 Print oTabellenListe.getCount()
 Print
oTabellenDokument.getSheets().getCount()
 Tabelle31 =
oTabellenDokument.getSheets().getByIndex(1)

the macro handled both printing statements.


And what did they print? My guess is that they both printed the valued 1.
Is this correct? Is this the value that you expected?


The statement for Tabelle31 is not executed anymore; the system throws an
indexoutofboundexception. The sheet itself does not show on the buttom
the sheet-id-numbers Tabelle11 und Tabelle31, but Tabelle1. One line
below, the sheet shows Tabelle1/1. Maybe the code for ThisComponent and
lockcontrollers  is incorrect?


I am not sure what you are saying. Are you implying that you are not
referencing the correct document?



Regards,

Rudi

- Original Message - From: "Andrew Douglas Pitonyak"
<[EMAIL PROTECTED]>
To: 
Sent: Thursday, December 04, 2008 2:25 PM
Subject: Re: [api-dev] Calc with two tables



Rudolf Huber wrote:

Hallo,

the following sequence leads to an "indexoutofboundexception". In the
beginning I have the opening statements:
Dim Desktop As Object
Dim Platzhalter()
Dim Url As String
Dim oTabellenDokument As Object   Rem the
entire Document
Dim oTabellenListe As Object   Rem
Collection of sheets
Dim Tabelle11 As Object  Rem
sheet
Dim Tabelle31 As Object  Rem
sheet
thereafter a little further down: :

oTabellenDokument = ThisComponent
oTabellenDokument.lockcontrollers
EndSpalte = ZellenBereich.EndColumn
EndZeile = ZellenBereich.EndRow
Desktop = CreateUnoService("com.sun.star.frame.Desktop")
Url = "file:///a:/test.ods"
oTabellenDokument = Desktop.loadComponentFromURL(Url, "_blank", 0,
Platzhalter())
oTabellenListe = oTabellenDokument.getSheets()
Tabelle11  = oTabellenListe.getByIndex(0)

again further down, the

Re: [api-dev] Calc with two tables

2008-12-04 Thread Rudolf Huber

Hallo Andrew,


thanks for the prompt answer. Instead of

   Tabelle31 = oTabellenListe.getByIndex(1)

I coded

 Print oTabellenListe.getCount()
 Print 
oTabellenDokument.getSheets().getCount()
 Tabelle31 = 
oTabellenDokument.getSheets().getByIndex(1)


the macro handled both printing statements. The statement for Tabelle31 is 
not executed anymore; the system throws an indexoutofboundexception. The 
sheet itself does not show on the buttom the sheet-id-numbers Tabelle11 und 
Tabelle31, but Tabelle1. One line below, the sheet shows Tabelle1/1. Maybe 
the code for ThisComponent and lockcontrollers  is incorrect?


Regards,

Rudi

- Original Message - 
From: "Andrew Douglas Pitonyak" <[EMAIL PROTECTED]>

To: 
Sent: Thursday, December 04, 2008 2:25 PM
Subject: Re: [api-dev] Calc with two tables



Rudolf Huber wrote:

Hallo,

the following sequence leads to an "indexoutofboundexception". In the 
beginning I have the opening statements:

Dim Desktop As Object
Dim Platzhalter()
Dim Url As String
Dim oTabellenDokument As Object   Rem the entire 
Document
Dim oTabellenListe As Object   Rem 
Collection of sheets
Dim Tabelle11 As Object  Rem 
sheet
Dim Tabelle31 As Object  Rem 
sheet

thereafter a little further down: :

oTabellenDokument = ThisComponent
oTabellenDokument.lockcontrollers
EndSpalte = ZellenBereich.EndColumn
EndZeile = ZellenBereich.EndRow
Desktop = CreateUnoService("com.sun.star.frame.Desktop")
Url = "file:///a:/test.ods"
oTabellenDokument = Desktop.loadComponentFromURL(Url, "_blank", 0, 
Platzhalter())

oTabellenListe = oTabellenDokument.getSheets()
Tabelle11  = oTabellenListe.getByIndex(0)

again further down, the table Tabelle31 throughs the index-error:
Tabelle31 = oTabellenListe.getByIndex(1)

Up version 2.4 I had no problem with a structure like this. Now, I have 
version ooO 3. The table-collection  oTabellenListe should allow various 
sheets, however, macro stops after one table. In the sheet itself 
Tabelle1 in the beginning; after the url the second sheet shows 
Tabelle1/1. Neither Tabelle11 nor the Tabelle31 - which I coded - appear 
on the sheet. I do not know, why the macro ignores the definitions for 
the tables Tabelle11 und Tabelle31.


You said that more than one sheet exists in the document. What happens if 
you do this?


Print oTabellenListe.getCount()
Print oTabellenDokument.getSheets().getCount()
Tabelle31 = oTabellenDokument.getSheets().getByIndex(1)

--
Andrew Pitonyak
My Macro Document: http://www.pitonyak.org/AndrewMacro.odt
My Book: http://www.hentzenwerke.com/catalog/oome.htm
Info:  http://www.pitonyak.org/oo.php
See Also: http://documentation.openoffice.org/HOW_TO/index.html


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[api-dev] Calc with two tables

2008-12-04 Thread Rudolf Huber
Hallo,

the following sequence leads to an "indexoutofboundexception". In the beginning 
I have the opening statements: 

Dim Desktop As Object
Dim Platzhalter()
Dim Url As String
Dim oTabellenDokument As Object   Rem the entire 
Document
Dim oTabellenListe As Object   Rem Collection 
of sheets
Dim Tabelle11 As Object  Rem sheet
Dim Tabelle31 As Object  Rem sheet

thereafter a little further down: :

oTabellenDokument = ThisComponent
oTabellenDokument.lockcontrollers

EndSpalte = ZellenBereich.EndColumn
EndZeile = ZellenBereich.EndRow

Desktop = CreateUnoService("com.sun.star.frame.Desktop")
Url = "file:///a:/test.ods"
oTabellenDokument = Desktop.loadComponentFromURL(Url, "_blank", 0, 
Platzhalter())
oTabellenListe = oTabellenDokument.getSheets()
Tabelle11  = oTabellenListe.getByIndex(0)

again further down, the table Tabelle31 throughs the index-error: 

Tabelle31 = oTabellenListe.getByIndex(1)

Up version 2.4 I had no problem with a structure like this. Now, I have version 
ooO 3. The table-collection  oTabellenListe should allow various sheets, 
however, macro stops after one table. In the sheet itself Tabelle1 in the 
beginning; after the url the second sheet shows Tabelle1/1. Neither Tabelle11 
nor the Tabelle31 - which I coded - appear on the sheet. I do not know, why the 
macro ignores the definitions for the tables Tabelle11 und Tabelle31.

Thank you in advance.

Regards,

Rudolf Huber







Re: [api-dev] NumberFormats with decimals after the comma in calc-table

2008-10-09 Thread Rudolf Huber

Hi Niklas,

it is version 2.1.9095. Should I install the newest version and which would 
you suggest?


The ZahlenstringFormat =,123 was only test to check the function.

Thanks.

Regards,

Rudi

- Original Message - 
From: "Niklas Nebel" <[EMAIL PROTECTED]>

To: 
Sent: Thursday, October 09, 2008 6:31 PM
Subject: Re: [api-dev] NumberFormats with decimals after the comma in 
calc-table




On 10/ 9/08 01:59 PM, Rudolf Huber wrote:
I can stop the routine and look at the actual value Hoch = Val(Hoch) and 
get the correct result; it shows the
values after the comma (clicking at the field-Name "Hoch"); however, in 
the table itself the values show after
the comma the value zero; I have the coded ZahlenFormatString = 
"##.##0,000"; if I would code the
ZahlenFormatString = "##.##0,123", then I would get on each cell the 
correct value before the comma and
after the comma I would get ,123 as value. Is it possible that I have an 
incorrect version of OOo?


123 in the format string is read as a string literal.
You should really look at the resulting, filled spreadsheet document.
I'm not aware of any version that had such problems, but which version are 
you using?


Niklas

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [api-dev] NumberFormats with decimals after the comma in calc-table

2008-10-09 Thread Rudolf Huber

Hi Niklas,

I can stop the routine and look at the actual value Hoch = Val(Hoch) and get 
the correct result; it shows the
values after the comma (clicking at the field-Name "Hoch"); however, in the 
table itself the values show after
the comma the value zero; I have the coded ZahlenFormatString = 
"##.##0,000"; if I would code the
ZahlenFormatString = "##.##0,123", then I would get on each cell the correct 
value before the comma and
after the comma I would get ,123 as value. Is it possible that I have an 
incorrect version of OOo?


Regards,

Rudi



- Original Message - 
From: "Niklas Nebel" <[EMAIL PROTECTED]>

To: 
Sent: Thursday, October 09, 2008 11:51 AM
Subject: Re: [api-dev] NumberFormats with decimals after the comma in 
calc-table




On 10/ 9/08 09:01 AM, Rudolf Huber wrote:

these are the the other statements:

   Dim LokaleEinstellungen As New com.sun.star.lang.Locale
   Dim ZahlenFormat As Object
   Dim ZahlenFormatString As String
   Dim ZahlenFormatID As Long

   LokaleEinstellungen.Language = "de"
   LokaleEinstellungen.Country = "de"

in the table itself I got:

   Hoch = Val(Hoch)
   Hoch = Tabelle3.getCellByPosition(5, Count1).String
   Wert = Tabelle10.getCellByPosition(5, Start10)
   Wert.Value = Hoch
   Wert.NumberFormat = ZahlenFormatID


Did you take a closer look at the resulting document, to see if the cell 
contains the value you expected, and what number format the cell format 
dialog shows?


Niklas

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [api-dev] NumberFormats with decimals after the comma in calc-table

2008-10-09 Thread Rudolf Huber

Hallo Niklas,

these are the the other statements:

   Dim LokaleEinstellungen As New com.sun.star.lang.Locale
   Dim ZahlenFormat As Object
   Dim ZahlenFormatString As String
   Dim ZahlenFormatID As Long

   LokaleEinstellungen.Language = "de"
   LokaleEinstellungen.Country = "de"

in the table itself I got:

   Hoch = Val(Hoch)
   Hoch = Tabelle3.getCellByPosition(5, Count1).String
   Wert = Tabelle10.getCellByPosition(5, Start10)
   Wert.Value = Hoch
   Wert.NumberFormat = ZahlenFormatID

I really appreciate your help. Thanks.

Regards,

Rudi



- Original Message - 
From: "Niklas Nebel" <[EMAIL PROTECTED]>

To: 
Sent: Wednesday, October 08, 2008 5:27 PM
Subject: Re: [api-dev] NumberFormats with decimals after the comma in 
calc-table




On 10/ 8/08 04:52 PM, Rudolf Huber wrote:
first of all I thank you for the prompt response. The ZahlenFormatID  is 
5107.


No, I mean the format code string that is shown in the Format/Cells 
dialog. A key (ID) of 5107 is quite normal.


Niklas

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [api-dev] NumberFormats with decimals after the comma in calc-table

2008-10-08 Thread Rudolf Huber

Hi Niklas,

first of all I thank you for the prompt response. The ZahlenFormatID  is 
5107.


Regards,

Rudi

- Original Message - 
From: "Niklas Nebel" <[EMAIL PROTECTED]>

To: 
Sent: Wednesday, October 08, 2008 4:12 PM
Subject: Re: [api-dev] NumberFormats with decimals after the comma in 
calc-table




On 10/ 8/08 03:04 PM, Rudolf Huber wrote:
I tried various options to get the correct declaration for NumberFormat 
in calc. The LocalSetting.Language and Country is "de" for Germany.
In my table I get the value before the comma correctly, however, the 
after comma values show zeros. Below, you see the code for the format:


 ZahlenFormat = oTabellenDokument.NumberFormats
ZahlenFormatString = "##.##0,000"
ZahlenFormatId = ZahlenFormat.QueryKey(ZahlenFormatString, 
LokaleEinstellungen, True)

If  ZahlenFormatID = -1 Then
ZahlenFormatID = ZahlenFormat.addNew(ZahlenFormatString, 
LokaleEinstellungen)

EndIf


The first "#" is unnecessary, but that shouldn't be a problem.

Do you apply the format to a cell? If so, what format code does the cell 
format dialog show for that cell after running the macro?


Niklas

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[api-dev] NumberFormats with decimals after the comma in calc-table

2008-10-08 Thread Rudolf Huber
Hallo,

I tried various options to get the correct declaration for NumberFormat in 
calc. The LocalSetting.Language and Country is "de" for Germany.
In my table I get the value before the comma correctly, however, the after 
comma values show zeros. Below, you see the code for the format:

 ZahlenFormat = oTabellenDokument.NumberFormats
ZahlenFormatString = "##.##0,000"

ZahlenFormatId = ZahlenFormat.QueryKey(ZahlenFormatString, 
LokaleEinstellungen, True)

If  ZahlenFormatID = -1 Then
ZahlenFormatID = ZahlenFormat.addNew(ZahlenFormatString, 
LokaleEinstellungen)
EndIf   

Your help would be appreciated. Thanks.

Rudi

[api-dev] New additional sheet

2008-09-24 Thread Rudolf Huber
Hallo,

As you can see, I am trying to add an additional sheet to my existing table. I 
tried many variations as you can see below. What is the correct version to 
handle this case: 

   
Dim Tabelle10 As Object
If oTabellenListe.hasByName("Tabelle10") Then
   MsgBox "Tabelle10 ist vorhanden"
  Else 
   oTabellenDokument = ThisComponent
   Tabelle10 = 
oTabellenDokument.createInstance("com.sun.star.sheet.Spreadsheet")
   oTabellenDokument = ThisComponent
   rem oTabellenDokument.oTabellenListe.insertByName("Tabelle10", Tabelle1)
   rem ThisComponent.getsheets.insertbyName("Tabelle10", Tabelle)
   oTabellenDokument.oTabellenListe.insertByName("Tabelle10", Tabelle10)
   MsgBox "Tabelle10 ist jetzt vorhanden"
EndIf 

rem myDoc.Sheets.insertNewByName("MySheet", 1)
rem myDoc = thisComponent
rem sheet=MyDoc.createInstance("com.sun.star.sheet.Spreadsheet")
rem myDoc.Sheets.insertByName("MySheet", Sheet)
rem thisComponent.getSheets.insertByName("NouvelleFeuille")

Many thanks in advance.

Regards,

Rudi



Fw: [api-dev] Error exception

2008-09-22 Thread Rudolf Huber

Hi Tobias,

I found the error. I am sorry, that I bothered you.

Greetings,

Rudi


- Original Message - 
From: "Rudolf Huber" <[EMAIL PROTECTED]>

To: 
Sent: Sunday, September 21, 2008 8:52 AM
Subject: Re: [api-dev] Error exception



Hi Tobias,

I now can elaborate further in this problem. I get to the point that the
first  400 rows the routine runs normal,
after that it jumps back and forth and does not come to an end. If you 
want,

I can send you the short version
of the routine. The table has about 1500 rows to cover. Many thanks again.

Greetings,

Rudi



- Original Message - 
From: "Rudolf Huber" <[EMAIL PROTECTED]>

To: 
Sent: Monday, September 15, 2008 10:18 AM
Subject: Re: [api-dev] Error exception



Hi Tobias,

first thanks for the very fast response.

The  routine works with 4 tables. The two sorts run without a problem.
After
table "Tabelle1", I can add three tables ("Tabelle4", "Tabelle2" and
"Tabelle3", where I want to scratch double-rows).  Before I want to 
remove

the double-rows (after sorting "Tabelle4" and "Tabelle2"),  the program
throws the exception. See the asterisks in the listing.
If you want I can send you the program as a table-file.

Thanks again.

Have a nice week.

Greetings,

Rudi

- Original Message - 
From: "Tobias Krais" <[EMAIL PROTECTED]>

To: 
Sent: Sunday, September 14, 2008 9:48 PM
Subject: Re: [api-dev] Error exception



Hi Rudi,


I have four calc tables in one program, each has 3000 rows and 30
columns. Close to the end the routine, the system throws an error
execption. If I add a meaningless statement the routine ends one
statement before. Can somebody help me. Thanks.


please give us some code. We cannot help you without it.

Greetings, Tobias

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]








-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [api-dev] Error exception

2008-09-21 Thread Rudolf Huber

Hi Tobias,

I now can elaborate further in this problem. I get to the point that the
first  400 rows the routine runs normal,
after that it jumps back and forth and does not come to an end. If you want,
I can send you the short version
of the routine. The table has about 1500 rows to cover. Many thanks again.

Greetings,

Rudi



- Original Message - 
From: "Rudolf Huber" <[EMAIL PROTECTED]>

To: 
Sent: Monday, September 15, 2008 10:18 AM
Subject: Re: [api-dev] Error exception



Hi Tobias,

first thanks for the very fast response.

The  routine works with 4 tables. The two sorts run without a problem.
After
table "Tabelle1", I can add three tables ("Tabelle4", "Tabelle2" and
"Tabelle3", where I want to scratch double-rows).  Before I want to remove
the double-rows (after sorting "Tabelle4" and "Tabelle2"),  the program
throws the exception. See the asterisks in the listing.
If you want I can send you the program as a table-file.

Thanks again.

Have a nice week.

Greetings,

Rudi

- Original Message - 
From: "Tobias Krais" <[EMAIL PROTECTED]>

To: 
Sent: Sunday, September 14, 2008 9:48 PM
Subject: Re: [api-dev] Error exception



Hi Rudi,


I have four calc tables in one program, each has 3000 rows and 30
columns. Close to the end the routine, the system throws an error
execption. If I add a meaningless statement the routine ends one
statement before. Can somebody help me. Thanks.


please give us some code. We cannot help you without it.

Greetings, Tobias

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [api-dev] Error exception

2008-09-15 Thread Rudolf Huber

Hi Tobias,

first thanks for the very fast response.

The  routine works with 4 tables. The two sorts run without a problem. After
table "Tabelle1", I can add three tables ("Tabelle4", "Tabelle2" and
"Tabelle3", where I want to scratch double-rows).  Before I want to remove
the double-rows (after sorting "Tabelle4" and "Tabelle2"),  the program
throws the exception. See the asterisks in the listing.
If you want I can send you the program as a table-file.

Thanks again.

Have a nice week.

Greetings,

Rudi

- Original Message - 
From: "Tobias Krais" <[EMAIL PROTECTED]>

To: 
Sent: Sunday, September 14, 2008 9:48 PM
Subject: Re: [api-dev] Error exception



Hi Rudi,


I have four calc tables in one program, each has 3000 rows and 30
columns. Close to the end the routine, the system throws an error
execption. If I add a meaningless statement the routine ends one
statement before. Can somebody help me. Thanks.


please give us some code. We cannot help you without it.

Greetings, Tobias

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Sub Main


   Dim Desktop As Object
   Dim Platzhalter()
   Dim Url As String
   Dim oTabellenDokument As Object
   Dim oTabellenListe As Object
   Dim Tabelle1 As Object
   Dim Tabelle2 As Object
   Dim Tabelle3 As Object
   Dim Tabelle4 As Object
   Dim EndSpalte As Integer
   Dim EndZeile As Integer
   Dim I As Integer
   
   Dim Cursor As Object
   
   Rem 4.7.3 - 290

   Dim ZellenBereich As New com.sun.star.table.CellRangeAddress
   Rem 4.7.3 - 293
   Dim ZellenAdresse As New com.sun.star.table.CellAddress 
   Rem 4.7.3 - 290

   ZellenBereich.Sheet = 0
   
   ZellenBereich.StartColumn = 0

   ZellenBereich.StartRow = 0
   ZellenBereich.EndColumn = 30
   ZellenBereich.EndRow = 3300
   
   ZellenAdresse.Sheet = 0

   ZellenAdresse.Column = 0
   ZellenAdresse.Row = 0
   
   EndSpalte = ZellenBereich.EndColumn

   EndZeile = ZellenBereich.EndRow
   
   Dim ErstV As String

   Dim W_ISIN As Integer
   Dim W_WKN As Integer
   Dim USSymbol As String
   Dim Laenge As Long
 
   Desktop = CreateUnoService("com.sun.star.frame.Desktop")

   Url = "file:///a:/AktienEuroAmSonnt.sxc"
   oTabellenDokument = Desktop.loadComponentFromURL(Url, "_blank", 0, 
Platzhalter())
   rem oTabellenDokument = ThisComponent
   oTabellenListe = oTabellenDokument.getSheets()
   Tabelle1  = oTabellenListe.getByIndex(0)
   
   ZellenBereich = ThisComponent.CurrentController.getVisibleRange()

   Rem ZellenBereich = ThisComponent.CurrentController
   
   Rem Andrew Makro Abschnitt 6.23 
   Dim nCurCol As Integer

   Dim nCurRow As Integer
   Dim aAddress As String
   Rem Dim sFind As String
   rem Zelle = Tabelle1.GetCellbyPosition( 0, 0 )
   Cursor = Tabelle1.createCursor()
   rem Cursor = Tabelle1.createCursorByRange (Zelle)
   Cursor.GotoEndOfUsedArea( True)
   I = Cursor.getRangeAddress().EndRow
   EndZeile = I + 1
   
   If oTabellenListe.hasByName("Tabelle2") Then

  MsgBox "Tabelle2 wird gelöscht"
  oTabellenListe.removeByName("Tabelle2")
 Else
  MsgBox "Tabelle2 ist bereits gelöscht" 
   EndIf   
   
   If oTabellenListe.hasByName("Tabelle4") Then

  MsgBox "Tabelle4 wird gelöscht"
  oTabellenListe.removeByName("Tabelle4")
 Else
  MsgBox "Tabelle4 ist bereits gelöscht" 
   EndIf   
   
   
   If oTabellenListe.hasByName("Tabelle1") Then

  MsgBox "Tabelle2 ist nicht vorhanden"
  rem Tabelle1 = 
oTabellenDokument.createInstance("com.sun.star.sheet.Spreadsheet")
  oTabellenListe.copyByName("Tabelle1", "Tabelle2", 1)
 Else
  MsgBox "Tabelle1 ist nicht vorhanden"
   EndIf   
   
   If oTabellenListe.hasByName("Tabelle3") Then

  oTabellenListe.removeByName("Tabelle3")
  MsgBox "Tabelle3 ist vorhanden"
 Else 
  rem Tabelle1 = oTabellenDokument.createInstance("com.sun.star.sheet.Spreadsheet")

  rem oTabellenListe.insertByName("Tabelle3", Tabelle1)
  MsgBox "Tabelle3 ist jetzt vorhanden"
   EndIf 
   
   If oTabellenListe.hasByName("Tabelle1") Then

  MsgBox "Tabelle4 ist nicht vorhanden"
  Tabelle1 = 
oTabellenDokument.createInstance("com.sun.star.sheet.Spreadsheet")
  oTabellenListe.copyByName("Tabelle1", "Tabelle4", 1)
 Else
  MsgBox "Tabelle4 ist nicht vorhanden"
   EndIf 
   
   rem oTabellenDokument = ThisComponent

   Tabelle1 = oTabellenListe.getByName("Tabelle1")
   Tabelle2 = oTabellenListe.getByName("Tabelle2") 
   rem Tabelle3 = oTabellenListe.getByName("Tabelle3")
   Tabelle4 = oTabellenListe.getByName("Tabelle4") 
   
   Dim Entry As String

   Dim Entry1 As String
   Dim Entry2 As String
   Dim Count As Integer
   Dim Count1 As Integer
   Dim Temp As String
   Dim Zeile As Object
   Dim Zeile1 As Object
   Dim ISIN As String
   Dim ISIN1 As String
   Dim LByte As Variant
   
   Dim oSheetDSC As Object

   Dim oDSCRange As Object
   Dim aSortFields(0) As 

[api-dev] Error exception

2008-09-14 Thread Rudolf Huber
Hallo,

I have four calc tables in one program, each has 3000 rows and 30 columns. 
Close to the end the routine, the system throws an error execption. If I add a 
meaningless statement the routine ends one statement before. Can somebody help 
me. Thanks.

Rudi 

Re: [api-dev] Sort problem

2008-01-02 Thread Rudolf Huber

Hallo Mathias,

the example works perfectly. Thanks.

I wish your entire group a very Happy New Year 2008.

Greetings,

Rudi


- Original Message - 
From: "Mathias Röllig" <[EMAIL PROTECTED]>

To: 
Sent: Tuesday, November 20, 2007 5:42 PM
Subject: Re: [api-dev] Sort problem



Hello Hubert!

Where did you find this example?

Am 19.11.2007 21:09 schrieb Rudolf Huber:

Option Explicit

Sub Sorttest()

Dim oSheetDSC,oDSCRange As Object


'If you want to create typed variables you must
'declare the type of each variable:

Dim oSheetDSC As Object, oDSCRange As Object



Dim aSortFields(0) As New com.sun.star.util.SortField
Dim aSortDesc(0) As New com.sun.star.beans.PropertyValue


'What is "oTabellenListe"? I think:

Dim oDoc As Object
Dim oTabellenListe As Object
oDoc = ThisComponent  'or your document
oTabellenListe = oDoc.Sheets


oSheetDSC = oTabellenListe.getByIndex("Tabelle2")


'This is the same as
' oSheetDSC = oTabellenListe.getByIndex( 0 )

'Whether you use
' oSheetDSC = oTabellenListe.getByIndex( 1 )
'or
oSheetDSC = oTabellenListe.getByName( "Tabelle2" )



oDSCRange = oSheetDSC.getCellRangeByName("A1:Z2000")



rem ThisComponent.getCurrentController.select(oDSCRange)
rem getCurrentController.select(oDSCRange)


'You don't need the CurrentController here.



aSortFields(0).Field = 1


'Should it be the second column (B)?



aSortFields(0).SortAscending = TRUE
aSortDesc(0).Name = "SortFields"
aSortDesc(0).Value = aSortFields()
oDSCRange.Sort(aSortDesc())

End Sub



Greetings
Mathias
--
·-· cut here ·-·-·-·-·-·-·-·-·-·-·-·-·-·-·-·-·-·-·-·-·-·-·-·-·-·->8·-·

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[api-dev] Sort problem

2007-11-19 Thread Rudolf Huber
Hi everybody,

I tried your routines for the sort. In one of the examples it said that the 
routines only work for small tables. How, I have a calc-table for appr. 1200 
lines. How can I handles such a table.

As you can see, I took your example with minorchanges:

Dim oSheetDSC,oDSCRange As Object
Dim aSortFields(0) As New com.sun.star.util.SortField
Dim aSortDesc(0) As New com.sun.star.beans.PropertyValue
'set your sheet name
rem oSheetDSC = ThisComponent.oTabellenListe.getByIndex("Tabelle2")
oSheetDSC = oTabellenListe.getByIndex("Tabelle2")
'set your range address
oDSCRange = oSheetDSC.getCellRangeByName("A1:Z2000")
rem ThisComponent.getCurrentController.select(oDSCRange)
rem getCurrentController.select(oDSCRange)
aSortFields(0).Field = 1
aSortFields(0).SortAscending = TRUE
aSortDesc(0).Name = "SortFields"
aSortDesc(0).Value = aSortFields()
oDSCRange.Sort(aSortDesc())

The CurrentController statement causes an error; probably because I have no 
form in the routine. Therefore I have on only a REM statement.

Thanks in advance.

Rudi 

Re: Fw: [api-dev] Unanswered Request - Fw: [api-dev] HTML and Spreadsheet - BASIC

2006-03-20 Thread Rudolf Huber
Hi Stephan,

I really appreciate your promp reaction; here are the parameter of
"tools-extras-internet":


   Tools-Internet-Proxy:

Proxy-Server: Manuell
Http-Proxy:   www-proxy.t-online.de Port: 80
Ftp-Proxy:ftp-proxy.t-online.de Port: 80

   No Parameters for Seperators



Search-Settings:

   - first the proposed settings of OOo-Version 1.1 for AltaVista ...HotBot
   - second: I added

 Name: Yahoo
 Type: And
 Prefix:   http://finance.yahoo.com
 Suffix:   (no entry)
 Seperator:+
 CaseMatch:None

   I also tried the from OOoBasic proposed search parameters

I also tried to to leave the internet-proxies with spaces; no luck also.

On my PC, I have OpenOffice and the macros on drive D:
Could this be the problem?

Thank you for your effort in advance.

Regards,


Rudi

- Original Message -
From: "Stephan Wunderlich" <[EMAIL PROTECTED]>
Newsgroups: openoffice.api.dev
To: 
Sent: Friday, March 17, 2006 3:01 PM
Subject: Re: Fw: [api-dev] Unanswered Request - Fw: [api-dev] HTML and
Spreadsheet - BASIC


> Hi Rudolf,
>
> > unfortunately, I have to bother you again. I tried all imaginable
> > possiblities to get the result.
> > I went through all options om thje menue "extras"  of OO1.1.4. Everytime
I
> > get the following
> > replay   in the cell:
> >
> > the link could not be updated
> >
> > This message I get up to eight-times; the messages appear in the first
row,
> > beginning at (0,0).
> > Within the spreadsheet, I can click at the position (0,0) for the
contents
> > of the web-site of
> > finance.yahoo (as stated below) and I get the desired result, Thus it
cannot
> > be problem
> > of the settings of the IE. It must be one of the parameters of OO, which
I
> > probably did
> > not set correctly.  Maybe you can send me a web-page which explains this
> > problem. I
> > looked at google and yahoo with no result.
> >
> > Thank you very much in advance.
>
> are you sure your proxy settings at "Tools-Extras-Internet" are correct ?
>
> Regards
>
> Stephan
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Fw: [api-dev] Unanswered Request - Fw: [api-dev] HTML and Spreadsheet - BASIC

2006-03-17 Thread Rudolf Huber
Hello Stephan,

unfortunately, I have to bother you again. I tried all imaginable
possiblities to get the result.
I went through all options om thje menue "extras"  of OO1.1.4. Everytime I
get the following
replay   in the cell:

the link could not be updated

This message I get up to eight-times; the messages appear in the first row,
beginning at (0,0).
Within the spreadsheet, I can click at the position (0,0) for the contents
of the web-site of
finance.yahoo (as stated below) and I get the desired result, Thus it cannot
be problem
of the settings of the IE. It must be one of the parameters of OO, which I
probably did
not set correctly.  Maybe you can send me a web-page which explains this
problem. I
looked at google and yahoo with no result.

Thank you very much in advance.

Rudi


- Original Message -
From: "Stephan Wunderlich" <[EMAIL PROTECTED]>
Newsgroups: openoffice.api.dev
To: 
Sent: Monday, February 20, 2006 10:27 AM
Subject: Re: [api-dev] Unanswered Request - Fw: [api-dev] HTML and
Spreadsheet - BASIC


> Hi Rudolf,
>
> > thank you for your prompt message.
>
> you are most welcome :-)
>
> > I tried VISIBLE = TRUE also. It shows the the link "LINK", but I do not
see
> > the contents. The problem seems to be to get
> > the contents into a defined cell.  Apparently, I have to enlarge the
size of
> > the cell. Is there a method to  transfer the contents of the web-page of
the
> > cess  from my spreadsheet table to CSV-format file. Once I  can achieve
> > this I can solve the problem.
>
> The following macro should get the webpage into calc
>
> sName="SUNW"
> oSheet = ThisComponent.Sheets(0)
> sUrl = "http://finance.yahoo.com/q?s="; + sName
> AreaLinks = ThisComponent.Arealinks
> xCell = oSheet.getCellByPosition(0,0).CellAddress
> Arealinks.insertAtPosition(xCell, sUrl, "html_all",
> "calc_HTML_WebQuery", "" )
>
> You could choose an additional invisible sheet as in your sample to
> place the data there, then link the essential part of this data to lets
> say your first sheet and save the document using XStorable.storeToURL,
> thereby using the csv-filter.
>
> Hope that helps
>
> Regards
>
> Stephan
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [api-dev] answered Request - Fw: [api-dev] HTML and Spreadsheet - BASIC

2006-03-06 Thread Rudolf Huber
Hi Stephan,

the message which I get always is

the link could not be updated

I tried various settings, including all security settings under
EXTRAS-options and options under IE Version 6. I looked at the
setup-procedures regarding security. I run this macro under WindowsME and
Version OO1.1.4. I tried your macro and I tried various options with
arealinks and sheetlink. No luck.  Thank you for your help in advance.

Using the hyperlink function in a cell - without a macro - I have no
problem.

Regards,

Rudi

- Original Message -
From: "Stephan Wunderlich" <[EMAIL PROTECTED]>
Newsgroups: openoffice.api.dev
To: 
Sent: Monday, February 20, 2006 10:27 AM
Subject: Re: [api-dev] Unanswered Request - Fw: [api-dev] HTML and
Spreadsheet - BASIC


> Hi Rudolf,
>
> > thank you for your prompt message.
>
> you are most welcome :-)
>
> > I tried VISIBLE = TRUE also. It shows the the link "LINK", but I do not
see
> > the contents. The problem seems to be to get
> > the contents into a defined cell.  Apparently, I have to enlarge the
size of
> > the cell. Is there a method to  transfer the contents of the web-page of
the
> > cess  from my spreadsheet table to CSV-format file. Once I  can achieve
> > this I can solve the problem.
>
> The following macro should get the webpage into calc
>
> sName="SUNW"
> oSheet = ThisComponent.Sheets(0)
> sUrl = "http://finance.yahoo.com/q?s="; + sName
> AreaLinks = ThisComponent.Arealinks
> xCell = oSheet.getCellByPosition(0,0).CellAddress
> Arealinks.insertAtPosition(xCell, sUrl, "html_all",
> "calc_HTML_WebQuery", "" )
>
> You could choose an additional invisible sheet as in your sample to
> place the data there, then link the essential part of this data to lets
> say your first sheet and save the document using XStorable.storeToURL,
> thereby using the csv-filter.
>
> Hope that helps
>
> Regards
>
> Stephan
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>



TestWunderlich.sxc
Description: OpenOffice Calc spreadsheet
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Re: [api-dev] Unanswered Request - Fw: [api-dev] HTML and Spreadsheet - BASIC

2006-02-19 Thread Rudolf Huber
Hi Stephan,

thank you for your prompt message.

I tried VISIBLE = TRUE also. It shows the the link "LINK", but I do not see
the contents. The problem seems to be to get
the contents into a defined cell.  Apparently, I have to enlarge the size of
the cell. Is there a method to  transfer the contents of the web-page of the
cess  from my spreadsheet table to CSV-format file. Once I  can achieve
this I can solve the problem.

I checked all IE-internetoptions and Options of OOo with no luck. Do I
have to set certain parameters when I load OpenOffice?

Have a nice week.

Regards,

Rudi

- Original Message -
From: "Stephan Wunderlich" <[EMAIL PROTECTED]>
Newsgroups: openoffice.api.dev
To: 
Sent: Friday, February 17, 2006 11:05 AM
Subject: Re: [api-dev] Unanswered Request - Fw: [api-dev] HTML and
Spreadsheet - BASIC


> Hi Rudolf,
>
> your basic code inserts an invisible sheet to host your weblink ...
> changing the line
>
> oSheet.IsVisible = FALSE
>
> to
>
> oSheet.IsVisible = TRUE
>
> should show you the sheet "Link" with the data inside.
>
> Hope that helps
>
> Regards
>
> Stephan
>
>
> > Hello,
> >
> > since I did not get a response to my question below I try again. Also I
> > tested numerous variations to handle
> > the "LINK" in connection with various filters to store the contents of a
> > web-page in a file of "CSV" format,
> > I was not successful up-to-now. Maybe somebody can help me.
> > Have a nice week-end.
> >
> > Rudi
> >
> >
> > - Original Message -
> > From: "Rudolf Huber" <[EMAIL PROTECTED]>
> > To: 
> > Sent: Wednesday, November 16, 2005 9:15 AM
> > Subject: [api-dev] HTML and Spreadsheet
> >
> >
> >
> >>Hello,
> >>
> >>I am trying to get the following routine with the functions HTTP and
> >>Spreadsheet to run under OOo 1.1.4. Neither the HTML- nor the
> >>CSV-filter-options function.  When I look at the spreadsheet I see no
> >
> > link;
> >
> >>however, when I check the menue Edit-Sheet-Select the sheet names show
the
> >>LINK for the HTML-page. Although the following lines show the entire
> >>routine,
> >>only the last ten lines are really important:
> >>
> >>
> >>=
> >>REM * BASIC *
> >>Option Explicit
> >>  Const STOCK_COLUMN = 2
> >>  Const STOCK_ROW = 7
> >>
> >>Sub Main
> >>  GetHyperllinkT
> >>End Sub
> >>Sub GetHyperlinkT
> >> Dim Desktop As Object
> >> Dim sName As String
> >> Dim oDoc As Object
> >> Dim NoParm()
> >> Dim oSheets As Object
> >> Dim oSheet As Object
> >> Dim oRanges As Object
> >> Dim oCells As Object
> >> oDoc = ThisComponent
> >> oDoc.addActionLock
> >> oSheets = oDoc.Sheets(0)
> >> Desktop = CreateUnoService("com.sun.star.frame.Desktop")
> >> oSheets = oDoc.getSheets()
> >> If oDoc.Sheets.hasByName("Link") Then
> >>  oDoc.Sheets.removeByName("Link")
> >> End If
> >> sName = "AMD"
> >> Dim sUrl As String, sFilter As String
> >> Dim sOptions As String
> >> oSheets = oDoc.Sheets
> >> If oSheets.hasByName("Link") Then
> >>oSheet = oSheets.getByName("Link")
> >>  Else
> >> oSheet =
> >>
> >>oDoc.createInstance("com.sun.star.sheet.Spreadsheet")
> >> oDoc.Sheets.insertByName("Link", oSheet)
> >>oSheet.IsVisible = FALSE
> >> End If
> >> sUrl = "http://finance.yahoo.com/q?s="; + sName   rem +
> >
> > ".html"
> >
> >> sFilter = "HTML (StarCalc)"
> >> sOptions = ""
> >> rem sFilter = "Text - txt - csv (StarCalc)"
> >> rem sOptions =
> >>"44,34,SYSTEM,1,1/10/2/10/3/10/4/10/5/10/6/10/7/10/8/10/9/10"
> >> oSheet.link(sURL, "Link", "", "",
> >>com.sun.star.sheet.SheetLinkMode.NONE)
> >> oDoc = Desktop.loadComponentFromURL(sUrl, "_blank", 0,
NoParm())
&g

[api-dev] Unanswered Request - Fw: [api-dev] HTML and Spreadsheet - BASIC

2006-02-16 Thread Rudolf Huber
Hello,

since I did not get a response to my question below I try again. Also I
tested numerous variations to handle
the "LINK" in connection with various filters to store the contents of a
web-page in a file of "CSV" format,
I was not successful up-to-now. Maybe somebody can help me.
Have a nice week-end.

Rudi


- Original Message -
From: "Rudolf Huber" <[EMAIL PROTECTED]>
To: 
Sent: Wednesday, November 16, 2005 9:15 AM
Subject: [api-dev] HTML and Spreadsheet


> Hello,
>
> I am trying to get the following routine with the functions HTTP and
> Spreadsheet to run under OOo 1.1.4. Neither the HTML- nor the
> CSV-filter-options function.  When I look at the spreadsheet I see no
link;
> however, when I check the menue Edit-Sheet-Select the sheet names show the
> LINK for the HTML-page. Although the following lines show the entire
> routine,
> only the last ten lines are really important:
>
>
> =
> REM * BASIC *
> Option Explicit
>   Const STOCK_COLUMN = 2
>   Const STOCK_ROW = 7
>
> Sub Main
>   GetHyperllinkT
> End Sub
> Sub GetHyperlinkT
>  Dim Desktop As Object
>  Dim sName As String
>  Dim oDoc As Object
>  Dim NoParm()
>  Dim oSheets As Object
>  Dim oSheet As Object
>  Dim oRanges As Object
>  Dim oCells As Object
>  oDoc = ThisComponent
>  oDoc.addActionLock
>  oSheets = oDoc.Sheets(0)
>  Desktop = CreateUnoService("com.sun.star.frame.Desktop")
>  oSheets = oDoc.getSheets()
>  If oDoc.Sheets.hasByName("Link") Then
>   oDoc.Sheets.removeByName("Link")
>  End If
>  sName = "AMD"
>  Dim sUrl As String, sFilter As String
>  Dim sOptions As String
>  oSheets = oDoc.Sheets
>  If oSheets.hasByName("Link") Then
> oSheet = oSheets.getByName("Link")
>   Else
>  oSheet =
>
> oDoc.createInstance("com.sun.star.sheet.Spreadsheet")
>  oDoc.Sheets.insertByName("Link", oSheet)
> oSheet.IsVisible = FALSE
>  End If
>  sUrl = "http://finance.yahoo.com/q?s="; + sName   rem +
".html"
>  sFilter = "HTML (StarCalc)"
>  sOptions = ""
>  rem sFilter = "Text - txt - csv (StarCalc)"
>  rem sOptions =
> "44,34,SYSTEM,1,1/10/2/10/3/10/4/10/5/10/6/10/7/10/8/10/9/10"
>  oSheet.link(sURL, "Link", "", "",
> com.sun.star.sheet.SheetLinkMode.NONE)
>  oDoc = Desktop.loadComponentFromURL(sUrl, "_blank", 0, NoParm())
>  oSheet = oSheets.getByIndex(0)
>  If oSheets.hasByName("Link") Then
>oSheet = oSheets.getByName("Link")
>MsgBox "sheet o.k."
> else
>MsgBox "no sheet"
>oSheet =
> oDoc.createInstance("com.sun.star.sheet.Spreadsheet" )
>oDoc.Sheets.insertByName( "Link", osheet )
>End If
> End Sub
>

> ==
>
>  I have no problem to store the HTML-page as a normal text-file under IE
> 6.0.
>
> Maybe, I have the incorrect parameter settings for OOo 1.1.4, which
prevent
> the display of the web-page in the sheet.
>
> Thanks.
>
> Rudi
>
>
>
>
>
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [api-dev] HTML and Spreadsheet

2005-11-16 Thread Rudolf Huber
Hello Niklas,

Thank you for the prompt answer.
I changed NONE to NORMAL and I set the parameter LINK to
spaces.  The routine seems to make an effort to get the sheet; however,
after a short time to system asks me to send an error report to SUN.
This I did not do yet. Maybe you have another idea.

Regards,

Rudi

- Original Message -
From: "Niklas Nebel" <[EMAIL PROTECTED]>
To: 
Sent: Wednesday, November 16, 2005 11:17 AM
Subject: Re: [api-dev] HTML and Spreadsheet


> Rudolf Huber wrote:
> > I am trying to get the following routine with the functions HTTP and
> > Spreadsheet to run under OOo 1.1.4. Neither the HTML- nor the
> > CSV-filter-options function.  When I look at the spreadsheet I see no
link;
> > however, when I check the menue Edit-Sheet-Select the sheet names show
the
> > LINK for the HTML-page. Although the following lines show the entire
> > routine,
> > only the last ten lines are really important:
>
> >  oSheet.link(sURL, "Link", "", "",
> > com.sun.star.sheet.SheetLinkMode.NONE)
>
> Two problems here:
> - SheetLinkMode.NONE doesn't do much. Use NORMAL instead.
> - The aSheetName parameter names a sheet in the source document, that
> is, the imported HTML file. Use an empty string to get the first sheet,
> regardless of its name.
>
> Niklas
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[api-dev] HTML and Spreadsheet

2005-11-16 Thread Rudolf Huber
Hello,

I am trying to get the following routine with the functions HTTP and
Spreadsheet to run under OOo 1.1.4. Neither the HTML- nor the
CSV-filter-options function.  When I look at the spreadsheet I see no link;
however, when I check the menue Edit-Sheet-Select the sheet names show the
LINK for the HTML-page. Although the following lines show the entire
routine,
only the last ten lines are really important:


=
REM * BASIC *
Option Explicit
  Const STOCK_COLUMN = 2
  Const STOCK_ROW = 7

Sub Main
  GetHyperllinkT
End Sub
Sub GetHyperlinkT
 Dim Desktop As Object
 Dim sName As String
 Dim oDoc As Object
 Dim NoParm()
 Dim oSheets As Object
 Dim oSheet As Object
 Dim oRanges As Object
 Dim oCells As Object
 oDoc = ThisComponent
 oDoc.addActionLock
 oSheets = oDoc.Sheets(0)
 Desktop = CreateUnoService("com.sun.star.frame.Desktop")
 oSheets = oDoc.getSheets()
 If oDoc.Sheets.hasByName("Link") Then
  oDoc.Sheets.removeByName("Link")
 End If
 sName = "AMD"
 Dim sUrl As String, sFilter As String
 Dim sOptions As String
 oSheets = oDoc.Sheets
 If oSheets.hasByName("Link") Then
oSheet = oSheets.getByName("Link")
  Else
 oSheet =

oDoc.createInstance("com.sun.star.sheet.Spreadsheet")
 oDoc.Sheets.insertByName("Link", oSheet)
oSheet.IsVisible = FALSE
 End If
 sUrl = "http://finance.yahoo.com/q?s="; + sName   rem + ".html"
 sFilter = "HTML (StarCalc)"
 sOptions = ""
 rem sFilter = "Text - txt - csv (StarCalc)"
 rem sOptions =
"44,34,SYSTEM,1,1/10/2/10/3/10/4/10/5/10/6/10/7/10/8/10/9/10"
 oSheet.link(sURL, "Link", "", "",
com.sun.star.sheet.SheetLinkMode.NONE)
 oDoc = Desktop.loadComponentFromURL(sUrl, "_blank", 0, NoParm())
 oSheet = oSheets.getByIndex(0)
 If oSheets.hasByName("Link") Then
   oSheet = oSheets.getByName("Link")
   MsgBox "sheet o.k."
else
   MsgBox "no sheet"
   oSheet =
oDoc.createInstance("com.sun.star.sheet.Spreadsheet" )
   oDoc.Sheets.insertByName( "Link", osheet )
   End If
End Sub

==

 I have no problem to store the HTML-page as a normal text-file under IE
6.0.

Maybe, I have the incorrect parameter settings for OOo 1.1.4, which prevent
the display of the web-page in the sheet.

Thanks.

Rudi







-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]