Jun
18
Excel密码保护的解除方法与解除原理 Excel弹出“您试图更改的单元格或图表受保护,因而是只读的。若要修改受保护单元格或图表,请先使用‘撤消工作表保护’命令(在‘审阅’选项卡的‘更改’组中)来取消保护。可能会提示您输入密码
Jun
18
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using Microsoft.Office.Interop.Excel; using System.Data.SqlClient; using System.Data.OleDb; using System.Reflection; namespace ExcelPrj { /// /// Excel 系统中的主文件Excel.exe 本身就是 COM 组件,通过在.NET 项目中引用Exel.exe 文件可以实现对Excel 的功能控制 /// 与COM 组件相互操作是通过使用"包装类"(Wrapper Class) 和"代理"(Proxy) 的机制实现的.包装类使.N
Jun
18
public void GetExcel(System.Data.SqlClient.SqlDataReader dtData) { System.Web.UI.WebControls.GridView dgExport = null; // 当前对话 System.Web.HttpContext curContext = System.Web.HttpContext.Current; // IO用于导出并返回excel文件 System.IO.StringWriter strWriter = null; System.Web.UI.HtmlTextWriter htmlWriter = null; if (dtData != null) { // 设置编码和附件格式 System.Web.HttpContext.Current.Response.Clear(); System.Web.HttpContext.Current.Response.HeaderEncoding = System.Text.Encoding.GetEncoding("gb2312"); curContext.Response.ContentType = "application/vnd.ms-excel"; curCo
Jun
18
using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;using System.Net.NetworkInformation;using System.Data.OleDb;namespace Ex09_09{ public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { try { //设置连接字符串 string strOdbcCon = @"Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data Source=F:\C#光盘\09\Ex09_09\2006年图书销售情况.xls;Extended Properties=Excel 8.0"; OleDbConnection OleDB = new OleDbConnect
Jun
18
在excel中实现表头锁定的方法当我们编辑过长或过宽的Excel工作表时,需要向下或向上滚动屏幕,而表头也相应滚动,不能在屏幕上显示,这样我们搞不清要编辑的数据对应于表头的那一个信息。按下列方法可将表头锁定,使表头始终位于屏幕可视区域。 首先选定要锁定的表头,如果我们要将表头(







