using IronXL;WorkBook workBook = WorkBook.Create(ExcelFileFormat.XLSX);WorkSheet workSheet = workBook.DefaultWorkSheet;// Modify the cell's propertyworkSheet["A1"].Value = "Link to ironpdf.com";// Set hyperlink at A1 to https://ironpdf.com/workSheet.GetCellAt(0, 0).Hyperlink = "https://ironpdf.com/";workBook.SaveAs("setLinkHyperlink.xlsx");
using IronXL;
WorkBook workBook = WorkBook.Create(ExcelFileFormat.XLSX);
WorkSheet workSheet = workBook.DefaultWorkSheet;
// Modify the cell's property
workSheet["A1"].Value = "Link to ironpdf.com";
// Set hyperlink at A1 to https://ironpdf.com/
workSheet.GetCellAt(0, 0).Hyperlink = "https://ironpdf.com/";
workBook.SaveAs("setLinkHyperlink.xlsx");
ImportsIronXLPrivate workBook AsWorkBook = WorkBook.Create(ExcelFileFormat.XLSX)Private workSheet AsWorkSheet = workBook.DefaultWorkSheet' Modify the cell's propertyPrivate workSheet("A1").Value = "Link to ironpdf.com"' Set hyperlink at A1 to https://ironpdf.com/workSheet.GetCellAt(0, 0).Hyperlink = "https://ironpdf.com/"workBook.SaveAs("setLinkHyperlink.xlsx")
Imports IronXL
Private workBook As WorkBook = WorkBook.Create(ExcelFileFormat.XLSX)
Private workSheet As WorkSheet = workBook.DefaultWorkSheet
' Modify the cell's property
Private workSheet("A1").Value = "Link to ironpdf.com"
' Set hyperlink at A1 to https://ironpdf.com/
workSheet.GetCellAt(0, 0).Hyperlink = "https://ironpdf.com/"
workBook.SaveAs("setLinkHyperlink.xlsx")
using IronXL;using System.Linq;WorkBook workBook = WorkBook.Create(ExcelFileFormat.XLSX);WorkSheet workSheet1 = workBook.CreateWorkSheet("Sheet1");WorkSheet workSheet2 = workBook.CreateWorkSheet("Sheet2");// Create workbook(global) define nameworkSheet1["D5"].SaveAsNamedRange("Iron", true);// Create worksheet define nameworkSheet2["D10"].SaveAsNamedRange("Hello", false);// --== Within the same worksheet ==--// Set hyperlink to cell Z20workSheet1["A1"].Value = "Z20";workSheet1["A1"].First().Hyperlink = "Z20";// Set hyperlink to define name "Iron"workSheet1["A2"].Value = "Iron";workSheet1["A2"].First().Hyperlink = "Iron";// --== Across worksheet ==--// Set hyperlink to cell A1 of Sheet2workSheet1["A3"].Value = "A1 of Sheet2";workSheet1["A3"].First().Hyperlink = "Sheet2!A1";// Set hyperlink to define name "Hello" of Sheet2workSheet1["A4"].Value = "Define name Hello of Sheet2";workSheet1["A4"].First().Hyperlink = "Sheet2!Hello";workBook.SaveAs("setHyperlinkAcrossWorksheet.xlsx");
using IronXL;
using System.Linq;
WorkBook workBook = WorkBook.Create(ExcelFileFormat.XLSX);
WorkSheet workSheet1 = workBook.CreateWorkSheet("Sheet1");
WorkSheet workSheet2 = workBook.CreateWorkSheet("Sheet2");
// Create workbook(global) define name
workSheet1["D5"].SaveAsNamedRange("Iron", true);
// Create worksheet define name
workSheet2["D10"].SaveAsNamedRange("Hello", false);
// --== Within the same worksheet ==--
// Set hyperlink to cell Z20
workSheet1["A1"].Value = "Z20";
workSheet1["A1"].First().Hyperlink = "Z20";
// Set hyperlink to define name "Iron"
workSheet1["A2"].Value = "Iron";
workSheet1["A2"].First().Hyperlink = "Iron";
// --== Across worksheet ==--
// Set hyperlink to cell A1 of Sheet2
workSheet1["A3"].Value = "A1 of Sheet2";
workSheet1["A3"].First().Hyperlink = "Sheet2!A1";
// Set hyperlink to define name "Hello" of Sheet2
workSheet1["A4"].Value = "Define name Hello of Sheet2";
workSheet1["A4"].First().Hyperlink = "Sheet2!Hello";
workBook.SaveAs("setHyperlinkAcrossWorksheet.xlsx");
IRONVBCONVERTERERROR developers@ironsoftware.com
IRON VB CONVERTER ERROR developers@ironsoftware.com
using IronXL;using System.Linq;WorkBook workBook = WorkBook.Create(ExcelFileFormat.XLSX);WorkSheet workSheet = workBook.DefaultWorkSheet;// Set hyperlink to open file sample.xlsxworkSheet["A1"].Value = "Open sample.xslx";workSheet["A1"].First().Hyperlink = "ftp://C:/Users/sample.xlsx";// Set hyperlink to open file sample.xlsxworkSheet["A2"].Value = "Open sample.xslx";workSheet["A2"].First().Hyperlink = "file:///C:/Users/sample.xlsx";// Set hyperlink to email example@gmail.comworkSheet["A3"].Value = "example@gmail.com";workSheet["A3"].First().Hyperlink = "mailto:example@gmail.com";workBook.SaveAs("setOtherHyperlink.xlsx");
using IronXL;
using System.Linq;
WorkBook workBook = WorkBook.Create(ExcelFileFormat.XLSX);
WorkSheet workSheet = workBook.DefaultWorkSheet;
// Set hyperlink to open file sample.xlsx
workSheet["A1"].Value = "Open sample.xslx";
workSheet["A1"].First().Hyperlink = "ftp://C:/Users/sample.xlsx";
// Set hyperlink to open file sample.xlsx
workSheet["A2"].Value = "Open sample.xslx";
workSheet["A2"].First().Hyperlink = "file:///C:/Users/sample.xlsx";
// Set hyperlink to email example@gmail.com
workSheet["A3"].Value = "example@gmail.com";
workSheet["A3"].First().Hyperlink = "mailto:example@gmail.com";
workBook.SaveAs("setOtherHyperlink.xlsx");
ImportsIronXLImportsSystem.LinqDim workBook AsWorkBook = WorkBook.Create(ExcelFileFormat.XLSX)Dim workSheet AsWorkSheet = workBook.DefaultWorkSheet' Set hyperlink to open file sample.xlsxworkSheet("A1").Value = "Open sample.xslx"workSheet("A1").First().Hyperlink = "ftp://C:/Users/sample.xlsx"' Set hyperlink to open file sample.xlsxworkSheet("A2").Value = "Open sample.xslx"workSheet("A2").First().Hyperlink = "file:///C:/Users/sample.xlsx"' Set hyperlink to email example@gmail.comworkSheet("A3").Value = "example@gmail.com"workSheet("A3").First().Hyperlink = "mailto:example@gmail.com"workBook.SaveAs("setOtherHyperlink.xlsx")
Imports IronXL
Imports System.Linq
Dim workBook As WorkBook = WorkBook.Create(ExcelFileFormat.XLSX)
Dim workSheet As WorkSheet = workBook.DefaultWorkSheet
' Set hyperlink to open file sample.xlsx
workSheet("A1").Value = "Open sample.xslx"
workSheet("A1").First().Hyperlink = "ftp://C:/Users/sample.xlsx"
' Set hyperlink to open file sample.xlsx
workSheet("A2").Value = "Open sample.xslx"
workSheet("A2").First().Hyperlink = "file:///C:/Users/sample.xlsx"
' Set hyperlink to email example@gmail.com
workSheet("A3").Value = "example@gmail.com"
workSheet("A3").First().Hyperlink = "mailto:example@gmail.com"
workBook.SaveAs("setOtherHyperlink.xlsx")
// Remove all hyperlinks in column Afor (int i = 1; i <= 10; i++){ var cell = workSheet.GetCellAt(i, 0); if (cell != null && !string.IsNullOrEmpty(cell.Hyperlink)) { cell.RemoveHyperlink(); }}
// Remove all hyperlinks in column A
for (int i = 1; i <= 10; i++)
{
var cell = workSheet.GetCellAt(i, 0);
if (cell != null && !string.IsNullOrEmpty(cell.Hyperlink))
{
cell.RemoveHyperlink();
}
}
' Remove all hyperlinks in column AFor i AsInteger = 1 To 10 Dim cell = workSheet.GetCellAt(i, 0) If cell IsNot NothingAndAlsoNotString.IsNullOrEmpty(cell.Hyperlink) Then cell.RemoveHyperlink() End IfNext
' Remove all hyperlinks in column A
For i As Integer = 1 To 10
Dim cell = workSheet.GetCellAt(i, 0)
If cell IsNot Nothing AndAlso Not String.IsNullOrEmpty(cell.Hyperlink) Then
cell.RemoveHyperlink()
End If
Next
このアプローチは、インポートしたデータのクリーニングや、ハイパーリンクが適切でない可能性がある配布用のスプレッドシートを準備する場合に特に役立ちます。 より高度なセル操作テクニックについては、selecting and working with rangesのガイドをご覧ください。
How can I create FTP or file hyperlinks in an Excel sheet using IronXL?
IronXL supports FTP and file hyperlinks. To create them, use absolute paths starting with 'ftp://' for FTP and 'file:///' for local or network files, enabling access to documents stored on servers or shared locations.
What happens when I click a hyperlink created with IronXL in an Excel file?
Clicking a hyperlink will open the linked URL in your default web browser or trigger the appropriate application to handle the link, such as opening an email client for mailto links.
Does IronXL support the creation of email hyperlinks in Excel?
Yes, with IronXL, you can create email hyperlinks using the 'mailto:' scheme, which prompts the default email client to prepare a new message with a pre-addressed email recipient when clicked.
How can I enhance the appearance of hyperlinks in my Excel spreadsheet?
You can use formatting options within IronXL to set cell styles, such as fonts and colors, ensuring hyperlinks are visually distinct from regular text, enhancing usability and readability.