Hi,
I would like to insert hyperlink to file into excel cell.
What I have tried:
I was trying use this code but once hyperlink is inserted to excel when I checking the hyperlink is in cell but not active until I edit the cell then press enter.
I think its happens because the hyperlink is inserted as a text.
Could anyone can help me ?
<pre>Dim connectionString As String = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=EXCEL_DATA\2SV REARS RFT.xls;Extended Properties = ""Excel 12.0 Xml;HDR=YES"""
Dim insertStatement As String = "INSERT INTO [" & NOWEEK.Text & "$] ([LINE], [Date], [Shift], [Frame Type], [Quantity], [Problem], [Weld Number], [Welder]) VALUES ('=HYPERLINK(C:\SMART" & FRAMETYPE.Text & ".xlsx)','" + datee.Text + "','" + CHOSESHIFT.Text + "','" + FRAMETYPE.Text + "'," + QUANTITY.Text + ",'" + PROBLEM.Text + "','" + WELDNUMBER.Text + "','" + WELDERNAME.Text + "')"
Dim connection As New OleDbConnection(connectionString)
Dim command As New OleDbCommand(insertStatement, connection)
connection.Open()
command.ExecuteNonQuery()
connection.Close()
connection.Dispose()
command.Dispose()