On Wednesday 22 June 2005 09:39, Rothenhöfer Franz-Josef, R961 wrote:
> [ MODERATED ] ********************
> Hallo,
>
> meine Ausstattung XP-Prof, OO1.1.4 ohne JVM
>
> Problem:
>
> In ein bestehendes XLS-Sheet soll per Makro Daten aus eines dBase .dbf
> Datei übernommen werden.
>
> Ablauf:
>
> 1. Öffnen XLS-Datei
> 2. Dann per Makroaufzeichnung
> - öffnen DBF-Datei als 2. XLS Sheet
> - markieren und kopieren
> - einfügen in Original-XLS
> - Makro beenden und speichern
>
> Das Problem ist aber, dass im Makro nur die Zwischenablage ge"pastet" wird.
> D. h. bei einem Aufruf wird nicht die DBF- Datei sondern der Inhalt der
> Zwischenablage eingefügt.
>
> Wo kann der Fehler liegen???
>
> Auch nach Installation vom JVM 1.4.2 keine Änderung.
>
> Makro
>
> REM ***** BASIC *****
>
>
> sub Pfarr
> rem ----------------------------------------------------------------------
> rem define variables
> dim document as object
> dim dispatcher as object
> rem ----------------------------------------------------------------------
> rem get access to the document
> document = ThisComponent.CurrentController.Frame
> dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
>
> rem ----------------------------------------------------------------------
> rem dispatcher.executeDispatch(document, ".uno:Open", "", 0, Array())
>
> rem ----------------------------------------------------------------------
> dim args2(0) as new com.sun.star.beans.PropertyValue
> args2(0).Name = "ToPoint"
> args2(0).Value = "$A$2"
>
> dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args2())
>
> rem ----------------------------------------------------------------------
> dispatcher.executeDispatch(document, ".uno:Paste", "", 0, Array())
>
>
> end sub
>
As you are not subscribed you may not have seen that:
On Thursday 23 June 2005 03:39, Andrew Douglas Pitonyak wrote:
> Using the 2.0 Beta, I have opened an external database and then copied
> data into Calc.
> Because you are accessing a DBF file, perhaps you can use a different
> method.
> My wife told me that I have to go to bed now so I will not provide a
> solution, but....
> If the data is NOT to large, then you can
> 1. Open the DBF File.
> 2. Determine the used area as follows (taken from my free macro document):
>
> Dim oCell As Object
> Dim oCursor As Object
> Dim aAddress As Variant
> oCell = oSheet.GetCellbyPosition( 0, 0 )
> oCursor = oSheet.createCursorByRange(oCell)
> oCursor.GotoEndOfUsedArea(True)
> aAddress = oCursor.RangeAddress
>
> 3. Get the data as a single data array.
> 4. Open the new or target database.
> 5. Set all of the data in one shot as a data array.
>
> Sorry that I do not have time to produce the entire solution.
Please reply to [email protected] only.
--
CPH : openoffice.org contributor
Maybe your question has been answered already?
http://user-faq.openoffice.org/#FAQ
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]