🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.lang.vbasic
Article #104503

Re: [vb6] Kopiowanie komórek w OO bez schowka - ROZWIĄZANIE

#104503
From: TS
Date: Wed, 03 Mar 2010 07:51
25 lines
2478 bytes
> Używam open office do zapisu danych ze swojego programu do excela, czy 
> ktoś z Was może mi pomóc, mam procedurkę (poniżej), która kopiuje 
> zaznaczone komórki i wkleja je w wierszu niżej. Używam do tego schowka i 
> działa to dobrze, jednak chciałbym zrezygnować ze schowka i zrobić to poza 
> nim, jest taka procedura jak CopyRange w OO ale nie potrafię jej użyć 
> pomimo wielu znalezionych przykładów w makrach Muszę takie rozwiązanie 
> zrobić w VB6 i być może tu jest problem...
>
> Set oCells = oSheet.getCellRangeByPosition(0, iRowIndex - 2, iFieldCount - 
> 1, iRowIndex - 2)
> oCalcCtrl.Select (oCells)
> Call vDispatcher.executeDispatch(oCalcCtrl, ".uno:Copy", "", 0, vNoArg())
> Set oCells = oSheet.getCellByPosition(0, iRowIndex - 1)
> oCalcCtrl.Select (oCells)
> Call vDispatcher.executeDispatch(oCalcCtrl, ".uno:Paste", "", 0, vNoArg())

Znalazłem rozwiązanie, może komuś się przyda... :)

Set tSourceRange = oSheet.getCellRangeByPosition(0, iRowIndex - 2, 
iFieldCount - 1, iRowIndex - 2).RangeAddress
Set tTargetCell = oSheet.getCellByPosition(0, iRowIndex - 1).CellAddress
Call oSheet.copyRange(tTargetCell, tSourceRange)

pozdr
TS 
Technical Details
Message-ID: <hml54a$gok$1@nemesis.news.neostrada.pl>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.rmf.pl!agh.edu.pl!news.agh.edu.pl!news.onet.pl!news.nask.pl!news.nask.org.pl!news.unit0.net!feeder1.cambriumusenet.nl!feeder3.cambriumusenet.nl!feed.tweaknews.nl!209.197.12.242.MISMATCH!nx01.iad01.newshosting.com!newshosting.com!newsfeed.neostrada.pl!unt-exc-01.news.neostrada.pl!atlantis.news.neostrada.pl!news.neostrada.pl!not-for-mail
References: <hmgkhe$esq$1@nemesis.news.neostrada.pl>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.rmf.pl!agh.edu.pl!news.agh.edu.pl!news.onet.pl!news.nask.pl!news.nask.org.pl!news.unit0.net!feeder1.cambriumusenet.nl!feeder3.cambriumusenet.nl!feed.tweaknews.nl!209.197.12.242.MISMATCH!nx01.iad01.newshosting.com!newshosting.com!newsfeed.neostrada.pl!unt-exc-01.news.neostrada.pl!atlantis.news.neostrada.pl!news.neostrada.pl!not-for-mail
From: "TS" <tonspeed@poczta.fm>
Newsgroups: pl.comp.lang.vbasic
Subject: Re: [vb6] Kopiowanie komórek w OO bez schowka -
 ROZWIĄZANIE
Date: Wed, 3 Mar 2010 08:51:52 +0100
Organization: TP - http://www.tp.pl/
Lines: 27
Message-ID: <hml54a$gok$1@nemesis.news.neostrada.pl>
References: <hmgkhe$esq$1@nemesis.news.neostrada.pl>
NNTP-Posting-Host: czs234.internetdsl.tpnet.pl
X-Trace: nemesis.news.neostrada.pl 1267603402 17172 83.19.204.234 (3 Mar 2010 08:03:22 GMT)
X-Complaints-To: usenet@news.neostrada.pl
NNTP-Posting-Date: Wed, 3 Mar 2010 08:03:22 +0000 (UTC)
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5843
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
X-RFC2646: Format=Flowed; Response
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit