Selectecing mutiple cells in excel

Post Reply
Marc Vanzegbroeck
Posts: 1102
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium
Contact:

Selectecing mutiple cells in excel

Post by Marc Vanzegbroeck »

Hi,

In my program I put conditional formating, and also formuls on cells in excel.
The problem is that I don't have to put it on all the cells (so I can use range).
So what I do now is put is on each cell that need it, the condition.
The problem is that it take a link time (35sec)

I was thinking to do a multiple select, and put than only 1 time tteh condition on it.
How can I select multiple cells like you do by pressing CTRL while selecting cells in excel?

I was thinking by using the UNION-method, but can't get it to work. :cry:
Regards,
Marc

FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
User avatar
Otto
Posts: 4470
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

Re: Selectecing mutiple cells in excel

Post by Otto »

Hello Marc,

something off topic.

May I ask why you need to use EXCEL?

I am in our company and with my customers for my saying: "EXCEL is the greatest productivity killer in the company." known.
I don't like these self-made EXCEL solutions in companies.

But there are certainly good reasons to use EXCEL.

Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org

********************************************************************
Marc Vanzegbroeck
Posts: 1102
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium
Contact:

Re: Selectecing mutiple cells in excel

Post by Marc Vanzegbroeck »

Otto,

I'm creating a program for a chemical-company that automaticly the info coming from process-engineer and it will import the info directy in the process-database by the Apllication-Engineer. (I'm also working there also as a freelance DCS-Application-Engineer)
The process-engineers give the data in excel. The program reads the excel, and compare the data with the existing database.
The program put some colors, conditional formats and comboboxes on the excel, so the engineers see the differences, and can select the data that can be overwriten.
Then the programs reads the excel, and import the data.

For safety-reasons, the network of the Process-engineers and the process-network may not be connected to each other.

So the transfer of data between the process-engineers and the application-engineers is with excel-files.

Otto wrote:Hello Marc,

something off topic.

May I ask why you need to use EXCEL?

I am in our company and with my customers for my saying: "EXCEL is the greatest productivity killer in the company." known.
I don't like these self-made EXCEL solutions in companies.

But there are certainly good reasons to use EXCEL.

Best regards,
Otto
Regards,
Marc

FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
User avatar
Otto
Posts: 4470
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

Re: Selectecing mutiple cells in excel

Post by Otto »

Marc,
can't you use a Fivewin o mod harbour program for the imput.
Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org

********************************************************************
User avatar
driessen
Posts: 1239
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Re: Selectecing mutiple cells in excel

Post by driessen »

Otto,

I am using Excel quite a lot for reporting.
Why?

My applictions are used by laywers. The courts demands reports in Excel.

That's why I use Excel.

My opinion? Not that difficult at all. I have made quite some dynamic reports.
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 21.01 - Harbour 3.2.0 (October 2020) - xHarbour Builder (January 2020) - Bcc7
User avatar
Otto
Posts: 4470
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

Re: Selectecing mutiple cells in excel

Post by Otto »

Michel,
It is not a matter of difficult or not.

But I don't think it's good when office employees use EXCEL for solutions, it takes so much working time and the solutions are semi-professional. EXCEL is simply not suitable.
I keep seeing that a professional solution is much more productive and cheaper.
But that's just my experience. With these many EXCEL tables, you don't bring a standard into operation.
But we're talking about different missions here. You only use it as a reporting tool.
It is OK. But also one of the reasons why we don't get any further with EasyReport.

Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org

********************************************************************
Marc Vanzegbroeck
Posts: 1102
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium
Contact:

Re: Selectecing mutiple cells in excel

Post by Marc Vanzegbroeck »

Otto,

In my case, it's a data exchange between 2 different programs/systems.
The process-engineers are using a program that draw the functions that has to be implement in a process-system. The are using the same program for different vendors, like Honeywell, Siemens, Yokogawa, Emmerson,HIMA,....
That program can export to excel.

Normaly we have to build the functions manual on the process-system. In my case on a Honeywell DCS-system. That system has it's own import-files with it's own structure. It can't read data from another database. So we use excel for info like descriptors, ranges, alarms,... to import in the system...
Regards,
Marc

FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
User avatar
MaxP
Posts: 85
Joined: Thu Jul 12, 2007 2:02 pm
Contact:

Re: Selectecing mutiple cells in excel

Post by MaxP »

Hello Marc,

to select multiple cells in one step try to create a string with cell references.

Code: Select all

#include "FiveWin.ch"


FUNCTION MAIN()
        LOCAL   oExcel, oWorkBooks, oSheet, oRange
        
        TRY
                oExcel := TOleAuto():New( "Excel.Application" )
        CATCH
                oExcel := NIL
        END
        
        IF oExcel <> NIL
                oWorkBooks := oExcel:WorkBooks

                IF oWorkBooks <> NIL
                        oWorkBooks:Add()
                        oSheet := oExcel:ActiveSheet
                        
                        oRange := oSheet:Range( "B2:B2;C3:C3;D4:D4;E5:E5;F6:F6" )
                        
                        oRange:Value := 1
                        
                        oExcel:Visible := .T.
                ENDIF
        ENDIF
RETURN NIL
Best regards,
Massimo
Marc Vanzegbroeck
Posts: 1102
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium
Contact:

Re: Selectecing mutiple cells in excel

Post by Marc Vanzegbroeck »

Thank you Massimo, it's working fine.
Regards,
Marc

FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Post Reply