Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Excel automation
#2
Solved: 10 Years, 9 Months, 2 Weeks ago
@Sathiya,

To insert a hyperlink in the same file bt a different sheet, below is the formula.

Code:
=HYPERLINK("[aaa.xls]Sheet2!A1","Sheet2")

where
aaa.xls is the file name. Just pass the file name.
Sheet2 is the sheet name where you want to jump to.
A1 is range in the destination sheet where the cursor will move
Sheet2 is the friendly name to be displayed in the current sheet.

'***********
Let me know if you need more help.

Regards,
Ankesh

Sathiya,

I have wriiten a sample code which is working fine.
There are few assumption which i have made here. Sheets name are as Sheet1, Sheet2, Sheet3 and so on.
Hyperlink is in the A1 column.

Code:
strCompleteFilPath="C:\aaa.xls"
strTemp=Split(strCompleteFilPath,"\")
strFileName=strTemp(Ubound(strTemp))

Set objXL = CreateObject("Excel.Application")
objXL.visible = true


Set wkb = objXL.Workbooks.Open(strCompleteFilPath)
Set ws = wkb.Sheets(1)

'get cell data
'i am assuming that the sheet names are written in A1.
intRowCount=ws.usedrange.rows.count
For i=1 to intRowCount

    v_Range="A"&i
    v_Sheet="""["&strFileName&"]"&"Sheet"&i+1&"!A"&i&""""
    objXL.Range(v_Range).Value=Trim("=HyperLink("&v_Sheet&","&"""Sheet"&i+1&""""&")")

Next

Let me know if you need any help.

Regards,
Ankesh
Reply


Messages In This Thread
Excel automation - by Sathiya - 11-17-2012, 05:53 PM
RE: Excel automation - by Ankesh - 11-17-2012, 06:48 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  where can I find the help for excel & database automation abhi_biradar2006 0 1,877 05-20-2014, 01:08 AM
Last Post: abhi_biradar2006
  Need Excel template for mapping manual scripts to Automation scripts. ACCBAJPA 0 2,844 09-19-2013, 03:02 PM
Last Post: ACCBAJPA
  simple excel automation excellentpawan 1 2,462 07-06-2013, 04:08 PM
Last Post: Ankur
  Excel Report Automation Sathiyakum 1 4,012 07-05-2011, 01:35 PM
Last Post: rajpes
  Excel automation doubt AAB 1 2,987 03-24-2011, 02:01 PM
Last Post: basanth27

Forum Jump:


Users browsing this thread: 1 Guest(s)