Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

7 May, 2024: fms is rebuilding. Don't expect much in that section for quite a few days, maybe longer.


devel / comp.lang.xharbour / get last row#/cell# in an open excel file.

SubjectAuthor
* get last row#/cell# in an open excel file.timepro timesheet
+* Re: get last row#/cell# in an open excel file.timepro timesheet
|`* Re: get last row#/cell# in an open excel file.timepro timesheet
| `* Re: get last row#/cell# in an open excel file.timepro timesheet
|  `- Re: get last row#/cell# in an open excel file.timepro timesheet
`- Re: get last row#/cell# in an open excel file.timepro timesheet

1
get last row#/cell# in an open excel file.

<8287e265-516a-46e6-80d7-eaceff3d33e9n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=16975&group=comp.lang.xharbour#16975

  copy link   Newsgroups: comp.lang.xharbour
X-Received: by 2002:a05:622a:10f:b0:2e0:29ea:5ea1 with SMTP id u15-20020a05622a010f00b002e029ea5ea1mr15637794qtw.670.1646390521631;
Fri, 04 Mar 2022 02:42:01 -0800 (PST)
X-Received: by 2002:a37:9e81:0:b0:47d:8cd2:c54a with SMTP id
h123-20020a379e81000000b0047d8cd2c54amr2127611qke.218.1646390521517; Fri, 04
Mar 2022 02:42:01 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.xharbour
Date: Fri, 4 Mar 2022 02:42:01 -0800 (PST)
Injection-Info: google-groups.googlegroups.com; posting-host=27.56.154.105; posting-account=jZAeNwoAAABYWjMRM-FfqKkHfC3Iph0l
NNTP-Posting-Host: 27.56.154.105
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <8287e265-516a-46e6-80d7-eaceff3d33e9n@googlegroups.com>
Subject: get last row#/cell# in an open excel file.
From: timecosting@gmail.com (timepro timesheet)
Injection-Date: Fri, 04 Mar 2022 10:42:01 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 7
 by: timepro timesheet - Fri, 4 Mar 2022 10:42 UTC

in any open excel file:
-how to assign the last row#/cell# to a variable
-how to get the last not-empty row#. (like eof())

-how to assign the value/content of any cell to a variable
(is it: thetax:=osheet:cells(xx,yy):value)

thank you

Re: get last row#/cell# in an open excel file.

<0b1959de-750f-4de8-b72b-f520d61df98bn@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=16976&group=comp.lang.xharbour#16976

  copy link   Newsgroups: comp.lang.xharbour
X-Received: by 2002:a37:9746:0:b0:61f:ea7b:a488 with SMTP id z67-20020a379746000000b0061fea7ba488mr2284291qkd.618.1646395727039;
Fri, 04 Mar 2022 04:08:47 -0800 (PST)
X-Received: by 2002:a05:620a:1519:b0:648:bbdd:8feb with SMTP id
i25-20020a05620a151900b00648bbdd8febmr2209892qkk.634.1646395726893; Fri, 04
Mar 2022 04:08:46 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.xharbour
Date: Fri, 4 Mar 2022 04:08:46 -0800 (PST)
In-Reply-To: <8287e265-516a-46e6-80d7-eaceff3d33e9n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=27.56.154.105; posting-account=jZAeNwoAAABYWjMRM-FfqKkHfC3Iph0l
NNTP-Posting-Host: 27.56.154.105
References: <8287e265-516a-46e6-80d7-eaceff3d33e9n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <0b1959de-750f-4de8-b72b-f520d61df98bn@googlegroups.com>
Subject: Re: get last row#/cell# in an open excel file.
From: timecosting@gmail.com (timepro timesheet)
Injection-Date: Fri, 04 Mar 2022 12:08:47 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 13
 by: timepro timesheet - Fri, 4 Mar 2022 12:08 UTC

On Friday, March 4, 2022 at 4:12:02 PM UTC+5:30, timepro timesheet wrote:
> in any open excel file:
> -how to assign the last row#/cell# to a variable
> -how to get the last not-empty row#. (like eof())
>
> -how to assign the value/content of any cell to a variable
> (is it: thetax:=osheet:cells(xx,yy):value)
>
> thank you

in the cell's format, even if 'thetax:=osheet:cells(xx,yy):value' is Text
type(thetax) shows as N

Re: get last row#/cell# in an open excel file.

<9f08aa16-1c83-4f47-ae89-24447e541496n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=16977&group=comp.lang.xharbour#16977

  copy link   Newsgroups: comp.lang.xharbour
X-Received: by 2002:ac8:58c2:0:b0:2de:326e:9dcb with SMTP id u2-20020ac858c2000000b002de326e9dcbmr32009419qta.689.1646397410182;
Fri, 04 Mar 2022 04:36:50 -0800 (PST)
X-Received: by 2002:a05:622a:111:b0:2dd:dc84:4d42 with SMTP id
u17-20020a05622a011100b002dddc844d42mr31088620qtw.494.1646397410054; Fri, 04
Mar 2022 04:36:50 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.xharbour
Date: Fri, 4 Mar 2022 04:36:49 -0800 (PST)
In-Reply-To: <0b1959de-750f-4de8-b72b-f520d61df98bn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2405:204:20e:863c:458e:8d4:c2f4:4006;
posting-account=jZAeNwoAAABYWjMRM-FfqKkHfC3Iph0l
NNTP-Posting-Host: 2405:204:20e:863c:458e:8d4:c2f4:4006
References: <8287e265-516a-46e6-80d7-eaceff3d33e9n@googlegroups.com> <0b1959de-750f-4de8-b72b-f520d61df98bn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <9f08aa16-1c83-4f47-ae89-24447e541496n@googlegroups.com>
Subject: Re: get last row#/cell# in an open excel file.
From: timecosting@gmail.com (timepro timesheet)
Injection-Date: Fri, 04 Mar 2022 12:36:50 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 32
 by: timepro timesheet - Fri, 4 Mar 2022 12:36 UTC

On Friday, March 4, 2022 at 5:38:47 PM UTC+5:30, timepro timesheet wrote:
> On Friday, March 4, 2022 at 4:12:02 PM UTC+5:30, timepro timesheet wrote:
> > in any open excel file:
> > -how to assign the last row#/cell# to a variable
> > -how to get the last not-empty row#. (like eof())
> >
> > -how to assign the value/content of any cell to a variable
> > (is it: thetax:=osheet:cells(xx,yy):value)
> >
> > thank you
> in the cell's format, even if 'thetax:=osheet:cells(xx,yy):value' is Text
> type(thetax) shows as N

save the value/content of a cell(Text cell) to a dbf field
*
oexcel=createobject('excel.application')
cdest=diskname()+':\tax\subfold\filename.xlsx'
oexcel:workbooks:open(cdest)
osheet=oexcel:activesheet
oexcel:visible=.t.
for xxx=the-first-row-that-is-not-blank to the-last-row-of-the-open-excel-file
xcelinv:=osheet:cells(xxx,6):value && CRASHES HERE
if type('xcelinv')='N';xcelinv=str(xcelinv);end && have to as even if cell(xxx,6) is Text
sele dbffile
seek upper(left(xcelinv,10))
if found();repl taxinvoice with xcelinv;next
next

*error log
|Error excel.application:ACTIVESHEET/1 Unknown error: CELLS Arguments: ( [ 1] = |
|Type: N Val: 38 [ 2] = Type: N Val: 6) |
| |
|Error at ...: TOLEAUTO:CELLS(0) in Module: |

Re: get last row#/cell# in an open excel file.

<645b22fd-2374-4904-bc69-627123334467n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=16978&group=comp.lang.xharbour#16978

  copy link   Newsgroups: comp.lang.xharbour
X-Received: by 2002:a05:620a:2238:b0:663:76fa:7bbf with SMTP id n24-20020a05620a223800b0066376fa7bbfmr1604061qkh.48.1646473597684;
Sat, 05 Mar 2022 01:46:37 -0800 (PST)
X-Received: by 2002:a37:9e81:0:b0:47d:8cd2:c54a with SMTP id
h123-20020a379e81000000b0047d8cd2c54amr1585320qke.218.1646473597517; Sat, 05
Mar 2022 01:46:37 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news.szaf.org!3.eu.feeder.erje.net!feeder.erje.net!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.xharbour
Date: Sat, 5 Mar 2022 01:46:37 -0800 (PST)
In-Reply-To: <9f08aa16-1c83-4f47-ae89-24447e541496n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=27.56.154.105; posting-account=jZAeNwoAAABYWjMRM-FfqKkHfC3Iph0l
NNTP-Posting-Host: 27.56.154.105
References: <8287e265-516a-46e6-80d7-eaceff3d33e9n@googlegroups.com>
<0b1959de-750f-4de8-b72b-f520d61df98bn@googlegroups.com> <9f08aa16-1c83-4f47-ae89-24447e541496n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <645b22fd-2374-4904-bc69-627123334467n@googlegroups.com>
Subject: Re: get last row#/cell# in an open excel file.
From: timecosting@gmail.com (timepro timesheet)
Injection-Date: Sat, 05 Mar 2022 09:46:37 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 53
 by: timepro timesheet - Sat, 5 Mar 2022 09:46 UTC

On Friday, March 4, 2022 at 6:06:51 PM UTC+5:30, timepro timesheet wrote:
> On Friday, March 4, 2022 at 5:38:47 PM UTC+5:30, timepro timesheet wrote:
> > On Friday, March 4, 2022 at 4:12:02 PM UTC+5:30, timepro timesheet wrote:
> > > in any open excel file:
> > > -how to assign the last row#/cell# to a variable
> > > -how to get the last not-empty row#. (like eof())
> > >
> > > -how to assign the value/content of any cell to a variable
> > > (is it: thetax:=osheet:cells(xx,yy):value)
> > >
> > > thank you
> > in the cell's format, even if 'thetax:=osheet:cells(xx,yy):value' is Text
> > type(thetax) shows as N
> save the value/content of a cell(Text cell) to a dbf field
> *
> oexcel=createobject('excel.application')
> cdest=diskname()+':\tax\subfold\filename.xlsx'
> oexcel:workbooks:open(cdest)
> osheet=oexcel:activesheet
> oexcel:visible=.t.
> for xxx=the-first-row-that-is-not-blank to the-last-row-of-the-open-excel-file
> xcelinv:=osheet:cells(xxx,6):value && CRASHES HERE
> if type('xcelinv')='N';xcelinv=str(xcelinv);end && have to as even if cell(xxx,6) is Text
> sele dbffile
> seek upper(left(xcelinv,10))
> if found();repl taxinvoice with xcelinv;next
> next
>
> *error log
> |Error excel.application:ACTIVESHEET/1 Unknown error: CELLS Arguments: ( [ 1] = |
> |Type: N Val: 38 [ 2] = Type: N Val: 6) |
> | |
> |Error at ...: TOLEAUTO:CELLS(0) in Module: |

hi:

i am opening an existing excel file to read the 'values/content' of 'F' cell and save to a .dbf field.

my code:
oexcel=createobject('excel.application')
cdest=diskname()+':\tax\gst\einvoice.xlsx'
oexcel:workbooks:open(cdest)
osheet=oexcel:activesheet
*only opening the .xlsx to read, not to edit/write.
for xxx=6 to 10000 && given 10000 as am loss for the syntax for the last row in an open excel file
xceldate:=osheet:cells(xxx,4):value && IS THIS THE PROPER SYNTAX?
xcelinv:=osheet:cells(xxx,3):value && xcelinv type shows N if value is 1 or 2, even if the formatting shows Text
sele taxfile
seek xcelinv
repl gstdate with xceldate
next
oexcel:quit() && but this excel file still shows active in 'task manager', even after i exit my app.

thank you

Re: get last row#/cell# in an open excel file.

<f425bcc3-17e5-473c-948b-89b44874766an@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=16979&group=comp.lang.xharbour#16979

  copy link   Newsgroups: comp.lang.xharbour
X-Received: by 2002:ac8:5a91:0:b0:2de:25c5:1d68 with SMTP id c17-20020ac85a91000000b002de25c51d68mr2561395qtc.94.1646480586536;
Sat, 05 Mar 2022 03:43:06 -0800 (PST)
X-Received: by 2002:a05:6214:5082:b0:433:3114:e57e with SMTP id
kk2-20020a056214508200b004333114e57emr2253988qvb.120.1646480586430; Sat, 05
Mar 2022 03:43:06 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!nntp.club.cc.cmu.edu!45.76.7.193.MISMATCH!3.us.feeder.erje.net!feeder.erje.net!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.xharbour
Date: Sat, 5 Mar 2022 03:43:06 -0800 (PST)
In-Reply-To: <645b22fd-2374-4904-bc69-627123334467n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=27.56.154.105; posting-account=jZAeNwoAAABYWjMRM-FfqKkHfC3Iph0l
NNTP-Posting-Host: 27.56.154.105
References: <8287e265-516a-46e6-80d7-eaceff3d33e9n@googlegroups.com>
<0b1959de-750f-4de8-b72b-f520d61df98bn@googlegroups.com> <9f08aa16-1c83-4f47-ae89-24447e541496n@googlegroups.com>
<645b22fd-2374-4904-bc69-627123334467n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <f425bcc3-17e5-473c-948b-89b44874766an@googlegroups.com>
Subject: Re: get last row#/cell# in an open excel file.
From: timecosting@gmail.com (timepro timesheet)
Injection-Date: Sat, 05 Mar 2022 11:43:06 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 59
 by: timepro timesheet - Sat, 5 Mar 2022 11:43 UTC

On Saturday, March 5, 2022 at 3:16:38 PM UTC+5:30, timepro timesheet wrote:
> On Friday, March 4, 2022 at 6:06:51 PM UTC+5:30, timepro timesheet wrote:
> > On Friday, March 4, 2022 at 5:38:47 PM UTC+5:30, timepro timesheet wrote:
> > > On Friday, March 4, 2022 at 4:12:02 PM UTC+5:30, timepro timesheet wrote:
> > > > in any open excel file:
> > > > -how to assign the last row#/cell# to a variable
> > > > -how to get the last not-empty row#. (like eof())
> > > >
> > > > -how to assign the value/content of any cell to a variable
> > > > (is it: thetax:=osheet:cells(xx,yy):value)
> > > >
> > > > thank you
> > > in the cell's format, even if 'thetax:=osheet:cells(xx,yy):value' is Text
> > > type(thetax) shows as N
> > save the value/content of a cell(Text cell) to a dbf field
> > *
> > oexcel=createobject('excel.application')
> > cdest=diskname()+':\tax\subfold\filename.xlsx'
> > oexcel:workbooks:open(cdest)
> > osheet=oexcel:activesheet
> > oexcel:visible=.t.
> > for xxx=the-first-row-that-is-not-blank to the-last-row-of-the-open-excel-file
> > xcelinv:=osheet:cells(xxx,6):value && CRASHES HERE
> > if type('xcelinv')='N';xcelinv=str(xcelinv);end && have to as even if cell(xxx,6) is Text
> > sele dbffile
> > seek upper(left(xcelinv,10))
> > if found();repl taxinvoice with xcelinv;next
> > next
> >
> > *error log
> > |Error excel.application:ACTIVESHEET/1 Unknown error: CELLS Arguments: ( [ 1] = |
> > |Type: N Val: 38 [ 2] = Type: N Val: 6) |
> > | |
> > |Error at ...: TOLEAUTO:CELLS(0) in Module: |
> hi:
>
> i am opening an existing excel file to read the 'values/content' of 'F' cell and save to a .dbf field.
>
> my code:
> oexcel=createobject('excel.application')
> cdest=diskname()+':\tax\gst\einvoice.xlsx'
> oexcel:workbooks:open(cdest)
> osheet=oexcel:activesheet
> *only opening the .xlsx to read, not to edit/write.
> for xxx=6 to 10000 && given 10000 as am loss for the syntax for the last row in an open excel file
> xceldate:=osheet:cells(xxx,4):value && IS THIS THE PROPER SYNTAX?
> xcelinv:=osheet:cells(xxx,3):value && xcelinv type shows N if value is 1 or 2, even if the formatting shows Text
> sele taxfile
> seek xcelinv
> repl gstdate with xceldate
> next
> oexcel:quit() && but this excel file still shows active in 'task manager', even after i exit my app.
>
> thank you

this does not work. (still appears in task manager under 'background process')
oexcel:quit()
oExcel = NIL
release oExcel

Re: get last row#/cell# in an open excel file.

<54e69434-d0dc-41a4-8034-041f054df82dn@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=16980&group=comp.lang.xharbour#16980

  copy link   Newsgroups: comp.lang.xharbour
X-Received: by 2002:a05:6214:1643:b0:42c:2865:d1e7 with SMTP id f3-20020a056214164300b0042c2865d1e7mr2074725qvw.52.1646480642956;
Sat, 05 Mar 2022 03:44:02 -0800 (PST)
X-Received: by 2002:a05:622a:1483:b0:2de:2d6f:7b3b with SMTP id
t3-20020a05622a148300b002de2d6f7b3bmr2514949qtx.545.1646480642809; Sat, 05
Mar 2022 03:44:02 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.xharbour
Date: Sat, 5 Mar 2022 03:44:02 -0800 (PST)
In-Reply-To: <8287e265-516a-46e6-80d7-eaceff3d33e9n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=27.56.154.105; posting-account=jZAeNwoAAABYWjMRM-FfqKkHfC3Iph0l
NNTP-Posting-Host: 27.56.154.105
References: <8287e265-516a-46e6-80d7-eaceff3d33e9n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <54e69434-d0dc-41a4-8034-041f054df82dn@googlegroups.com>
Subject: Re: get last row#/cell# in an open excel file.
From: timecosting@gmail.com (timepro timesheet)
Injection-Date: Sat, 05 Mar 2022 11:44:02 +0000
Content-Type: text/plain; charset="UTF-8"
 by: timepro timesheet - Sat, 5 Mar 2022 11:44 UTC

On Friday, March 4, 2022 at 4:12:02 PM UTC+5:30, timepro timesheet wrote:
> in any open excel file:
> -how to assign the last row#/cell# to a variable
> -how to get the last not-empty row#. (like eof())
>
> -how to assign the value/content of any cell to a variable
> (is it: thetax:=osheet:cells(xx,yy):value)
>
> thank you

a member mailed me this:
xcelRows:=osheet:UsedRange:Rows:Count()
it works, thank you.

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor