-- 操作EXCEL表
想把EXCEL里的--替代成数值为0,哪里出错了呢????
Dim App As New MSExcel.Application \'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'定义Excel对象
App.DisplayAlerts=True \'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'是否显示警告信息对话框
Dim dlg As New OpenFileDialog \'\'\'\'\'\'\'\'\'\'\'\'\' \'定义一个新的OpenFileDialog
dlg.InitialDirectory="D:\\My Documents" \'\'\'\'\'\'\'\'\'\'\'\'\'\'\'最初显示的目录
dlg.Filter= "Excel文件|*.xls|Word文件|*.doc|Access文件|*.mdb" \'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'设置筛选器
If dlg.ShowDialog = DialogResult.OK Then \'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'如果用户单击了确定按钮
Dim Wb As MSExcel.Workbook = App.WorkBooks.Open(dlg.filename)
App.Visible = True
Dim Ws As MSExcel.WorkSheet = Wb.WorkSheets(0)
Ws.Activate
Dim Rg As MSExcel.Range = Ws.UsedRange
Rg.Select
Rg.Replace("--", 0)
End If
App.Quit