Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Adding hyperlinks to excel
Message
From
12/03/2014 12:28:26
 
 
To
12/03/2014 12:12:04
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01596105
Message ID:
01596311
Views:
47
Likes (1)
Use Sergeys tip

oExcel.Range("b2").Hyperlinks.Add(oExcel.Range("b2"),"http://www.bbc.co.uk")

>Sir Its working at my PC but I need to Press Enter key on B2 Cell on Excel Sheet to Get the Hyperlink Active ( Blue colour with Hand Cursor). How to make it active by default.
>
>Harsh
>
>
>
>>Try:
>>
oExcel.Range("b2").Select
>>oExcel.ActiveCell.FormulaR1C1 = "http://www.bbc.co.uk"
>>
>>Oh! In typing this just now I realized your hypertext link was malformed: "http:/bbc.co.uk" instead of "http://www.bbc.co.uk". Maybe that's the only issue.
>>
>>
>>>ActiveCell.FormulaR1C1 = "http://www.bbc.co.uk"
>>> Range("B5").Select
>>>
>>>
>>>>If you go in to Excel, turn on macro recording, and manually add a hyperlink, and then turn off macro recording, and go and examine the macro source code it generated with "edit macros" ... what does it show you?
>>>>
>>>>
>>>>>Hi rick no I'm afraid not.
>>>>>
>>>>>
>>>>>
>>>>>>Just a guess. Does using .FormulaR1C1 instead of .Value make a difference?
>>>>>>
>>>>>>
>>>>>>>Hi
>>>>>>>I want put some hyperlinks in a spreadsheet but when I add them they appear as text
>>>>>>>How can I add a hyperlink and have it appear as such
>>>>>>>Thanks
>>>>>>>
>>>>>>>SET STEP ON
>>>>>>>oExcel = CreateObject("Excel.Application")
>>>>>>>if vartype(oExcel) != "O"
>>>>>>> * could not instantiate Excel object
>>>>>>> * show an error message here
>>>>>>> return .F.
>>>>>>>ENDIF
>>>>>>>oWorkbook = oExcel.Application.Workbooks.Add()
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>oExcel.Range("b2").Value = "http:/bbc.co.uk"
>>>>>>>
>>>>>>>if val(oExcel.Version) > 11
>>>>>>> oWorkbook.SaveAs("C:\temp\foobar.xls", 56) && xlExcel8
>>>>>>>else
>>>>>>> oWorkbook.SaveAs("C:\temp\foobar.xls")
>>>>>>>ENDIF
>>>>>>>
>>>>>>>oExcel.quit()
Previous
Reply
Map
View

Click here to load this message in the networking platform