Using Npoi. hssf. usermodel; Using Npoi. Ss. usermodel; Using System. IO; Public Partial Program { Public Static Void Main ( String [] ARGs) {hssfworkbook = New Hssfworkbook (); isheet Sheet = Hssfworkbook. createsheet ( " Sheet1 " ); // Create a worksheet Irow ROW = sheet. createrow ( 0 ); // Create row Row. createcell ( 0 ). Setcellvalue ( " File URL " );// Create and set the first column value of the first row Row. createcell ( 1 ). Setcellvalue (datetime. Now. tow.datestring ()); // Second column Value Hssfhyperlink Link = New Hssfhyperlink (hyperlinktype. url ); // Link type. hyperlinktype. File cannot open local files. It can only be processed through URLs. Link. Address = " File: // D:/test.exe " ;// The file or URL to open, such as "http: // Cnblogs. com" Row. cells [ 0 ]. Hyperlink = link; // Open this link in the first row column // Write an xls file Using (Filestream file = New Filestream ( @" D: \ Npoi-test.xls " , Filemode. Create) {hssfworkbook. Write (File); file. Close ();}}}