How do i call a procedure

Topic Specific Tutorials and Tips.

Moderator: Rathinagiri

User avatar
serge_girard
Posts: 3161
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: How do i call a procedure

Post by serge_girard »

Robert,

Try this:

Code: Select all

oExcel:WorkSheets(1):UsedRange:Rows:Count
This will also count empty rows.

Serge
There's nothing you can do that can't be done...
User avatar
mol
Posts: 3718
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: How do i call a procedure

Post by mol »

So, go to line no. 65535 and decrease loop control util you reach first not empty row
User avatar
serge_girard
Posts: 3161
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: How do i call a procedure

Post by serge_girard »

Easier:

Code: Select all

 
for i = 1 to oExcel:WorkSheets(1):UsedRange:Rows:Count
  // do somethings
next
 
There's nothing you can do that can't be done...
User avatar
mol
Posts: 3718
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: How do i call a procedure

Post by mol »

I didn't know UsedRange. Thank you, Serge!
User avatar
serge_girard
Posts: 3161
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: How do i call a procedure

Post by serge_girard »

Google...internet ... !
New for me too!

Serge
There's nothing you can do that can't be done...
KDJ
Posts: 243
Joined: Mon Sep 05, 2016 3:04 am
Location: Poland

Re: How do i call a procedure

Post by KDJ »

mol wrote: Tue Sep 05, 2017 6:48 am ...
xlUp is defined in excel.ch as:

Code: Select all

#DEFINE xlUp   -4162
Where is excel.ch, I have not found.

Here is MS Excel documentation in single file (EXCEL 2013 Developer Documentation.chm): https://www.microsoft.com/en-us/downloa ... x?id=40326
User avatar
mol
Posts: 3718
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: How do i call a procedure

Post by mol »

I found excel.ch few years ago, I don't remember where. I can post it from my computer
ROBROS
Posts: 256
Joined: Thu May 25, 2017 6:30 pm
DBs Used: DBF
Location: D 83071 Stephanskirchen

Re: How do i call a procedure

Post by ROBROS »

Serge,

that sounds good,I will try it tomorrow at my office, on my Linux PC I have no excel installed, though I have virtualbox installed I have no licence to install excel.
Mareks proposal for checking for the first empty row doesn't work for me, but:
The last row has a cell always containig the same string (it's a footer row) so I could check instead for this string and then exit the loop.
Or I will check backwards for the first not emtpy row. (sophisicated)
I think this method is sure better, maybe one day they change the footerrow

Btw I think for further questions which I am afraid will occur, I will open a new thread with a new topic.

Guys, you are great, thank you so much.

Robert
Last edited by ROBROS on Tue Sep 05, 2017 7:03 pm, edited 3 times in total.
ROBROS
Posts: 256
Joined: Thu May 25, 2017 6:30 pm
DBs Used: DBF
Location: D 83071 Stephanskirchen

Re: How do i call a procedure

Post by ROBROS »

mol wrote: Tue Sep 05, 2017 6:26 pm I found excel.ch few years ago, I don't remember where. I can post it from my computer
Marek,

that would be great.
ROBROS
Posts: 256
Joined: Thu May 25, 2017 6:30 pm
DBs Used: DBF
Location: D 83071 Stephanskirchen

Re: How do i call a procedure

Post by ROBROS »

Just to give a feeback:

Serge's suggestion is working. :D
Post Reply