由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
JobHunting版 - delete sheets from Excel workbook in C#
相关主题
请教一个C++问题hash table 如果是doubly linked 为啥删除也是 O(1)呢
问个sql 题Excel Sheet Column Number哪种解法更好?
问一个smart pointer的问题合作组的人经常不回邮件
一定电挂了(G家)MS Office的问题
一个set,有add(i), del(i), count(i), size。写random()。discussing questions on Xmas eve
问一道题,system design google docs 如何防止conflictdeleted
贡献一道 C++ 题目周一onsite,附复习资料地址,求祝福
【BST创建,insert,delete的time complexity】Amazon面试问题(Convert word1 to word2)?
相关话题的讨论汇总
话题: workbook话题: sheets话题: excel话题: c#话题: delete
进入JobHunting版参与讨论
1 (共1页)
l******9
发帖数: 579
1
I need to delete some sheets from an Excel workbook in C#.
But, my code does not work.
// **aDeleteList** hold the sheets that need to be deleted from the
workbook wbk
static void delete_sht(ref MsExcel.Workbook wbk, List
aDeleteList)
{
MsExcel.Sheets my_st = wbk.Sheets;
foreach (MsExcel.Worksheet s in my_st)
{
if (aDeleteList.Contains(s.Name))
s.Delete();
int t1 = my_st.Count;
int t = wbk.Sheets.Count;
}
}
The values of t and t1 do not change no matter
s.Delete()
has been executed.
Any help would be appreciated.
z****0
发帖数: 4413
2
你从来不说中文, 是烙印吧



【在 l******9 的大作中提到】
: I need to delete some sheets from an Excel workbook in C#.
: But, my code does not work.
: // **aDeleteList** hold the sheets that need to be deleted from the
: workbook wbk
: static void delete_sht(ref MsExcel.Workbook wbk, List
: aDeleteList)
: {
: MsExcel.Sheets my_st = wbk.Sheets;
: foreach (MsExcel.Worksheet s in my_st)
: {

l******s
发帖数: 3045
3
stackoverflw is a better place to go for such questions.

【在 l******9 的大作中提到】
: I need to delete some sheets from an Excel workbook in C#.
: But, my code does not work.
: // **aDeleteList** hold the sheets that need to be deleted from the
: workbook wbk
: static void delete_sht(ref MsExcel.Workbook wbk, List
: aDeleteList)
: {
: MsExcel.Sheets my_st = wbk.Sheets;
: foreach (MsExcel.Worksheet s in my_st)
: {

1 (共1页)
进入JobHunting版参与讨论
相关主题
Amazon面试问题(Convert word1 to word2)?一个set,有add(i), del(i), count(i), size。写random()。
Please do not open attachment from [email protected]问一道题,system design google docs 如何防止conflict
问一个placement new 和 operator new的问题贡献一道 C++ 题目
红黑树以及AVL树的旋转平衡化应该是冷点【BST创建,insert,delete的time complexity】
请教一个C++问题hash table 如果是doubly linked 为啥删除也是 O(1)呢
问个sql 题Excel Sheet Column Number哪种解法更好?
问一个smart pointer的问题合作组的人经常不回邮件
一定电挂了(G家)MS Office的问题
相关话题的讨论汇总
话题: workbook话题: sheets话题: excel话题: c#话题: delete