Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

using microsoft automation components 2

Status
Not open for further replies.

martin123123

Programmer
Jun 23, 2003
18
0
0
NO
hello everyone.

My app is creating a TstringGrid.
I am sending this data over to a new Microsoft Excel workbook. I use the TExcelApplication.Create.
The problem is that one of the columns (the 'F' column) that I send to Excel contains URL. One URL for each cell. These URLs show as plain text in Excel.
How can I format these cells, so they are shown as hyperlinks? (click on them and a web browser appear..)

I've tried searching the web for days, but haven't found any references and documentation on Microsoft automation components..
 
i forgot to tell you the way i send the data over

TabGrid := VarArrayCreate([0,(R - 1),0,(C - 1)],VarOleStr);

for J := 0 to (C - 1) do
TabGrid[I,J] := StringGrid1.Cells[J,I];

Worksheet.Range['A1',Worksheet.Cells.Item[R,C]].Value := TabGrid;

 
hi again.
Sheet.Cells[1, 1] := '=HYPERLINK("
sorry about the extra ; in the last post.

Instead of Cells[1,1] you got to iterate x,x and fill your data url for each cells.. instead of yahoo.com as my test for a cell...

cheers,
mha
 
There is a method of automating explained in:

How to export data to Excel
faq102-1562

With this method I would select the cells and format it with Format --> Style

In VB
Sub Macro2()
Range("B1:B3").Select
Selection.Style = "Hyperlink"
End Sub

Delphi equivalent
Range['B1','B3'].Style = 'Hyperlink';

Regards



Steven van Els
SAvanEls@cq-link.sr
 
God idea.. Svanels. -> Range['B1','B3'].Style = 'Hyperlink';

Cheers,
mha
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top