Dim lieming As WinForm.CheckedListBox = e.Form.Controls("lieCheckedListBox")
Dim dlg As New SaveFileDialog '定义一个新的SaveFileDialog
dlg.Filter= "Excel文件|*.xlsx" '设置筛选器
If lieming.CheckedIndices.Count =0 Then
msgbox("不能所有列都不选")
Return
Else
If dlg.ShowDialog = DialogResult.Ok Then '如果用户单击了确定按钮
If sjdcxzb="fa piao库存资料表" Then
Dim post As Table = Tables("导出数据操作窗体_Table1")
Dim str As String = post.getColVisibleWidth
If lieming.value > "" Then
For Each c As Col In post.Cols
c.visible = False
Next
For Each s As String In lieming.value.split(",")
post.cols(s).Visible = True
Next
End If
post.SaveExcel(dlg.FileName, "fa piao库存资料表")
Dim idx As Integer = -1
For i As Integer = 0 To post.cols.count - 1
Dim dc As Col = post.cols(i)
If dc.Visible Then idx += 1
If dc.name = "是否已填开" Then
If dc.Visible =False Then idx = -1
Exit For
End If
Next
If idx > -1
Dim Book As New XLS.Book(dlg.FileName)
Dim Sheet As XLS.Sheet = Book.Sheets(0)
For n As Integer = 1 To Sheet.Rows.Count -1
If Sheet(n,idx ).Text = "True" '假设逻辑列是第6列
Sheet(n,idx ).Value = "是"
Else
Sheet(n,idx ).Value = "否"
End If
Next
Book.Save(dlg.FileName)
post.SetColVisibleWidth(str) '
End If
End If
End If
End If
e.Form.Close
怎么逻辑列都变成了“否”?