将单元格公式拖动到其他单元格时,Excel电子表格不会保存 [英] Excel Spreadsheet won't save when have dragged cell formulae to other cells

查看:108
本文介绍了将单元格公式拖动到其他单元格时,Excel电子表格不会保存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我对C#和.net完全不熟悉。我的任务是调试一个早已离开的人编写的应用程序。问题如下。



应用程序打开一个excel工作簿。如果您编辑excel工作簿,然后将其从应用程序中保存,除了一个案例之外,它在我尝试的每种情况下都能正常工作。如果选择包含公式单元格的单元格,然后选择并拖动右下角以将公式复制到下面的单元格中,则不起作用。如果我选择公式单元格,在另一个单元格中执行ctrl-C然后ctrl-V,它甚至可以正常工作。这只是拖延的事情,似乎会引起问题。



电话如下:

Hi,
I am totally new to C# and .net. I have the task of debugging an application which was written by someone who has long gone. The problem is as follows.

The application opens an excel workbook. If you edit the excel workbook and then save it from the application it works fine in every case I have tried except for one case. It does not work if a cell containing a formula cell is selected and then the bottom right-hand corner is selected and dragged to copy the formula into the cell below. It even works fine if I select the formula cell, do ctrl-C and then ctrl-V in another cell. It is just the dragging thing which seems to cause a problem.

The call is as follows:

currentwb.GetExcelWorkbook().SaveAs(
FileNameWithCxnID,
56,
Missing.Value,
Missing.Value,
Missing.Value,
Missing.Value,
Excel.XlSaveAsAccessMode.xlNoChange,
Missing.Value,
false,
Missing.Value,
Missing.Value,
Missing.Value);





我现在完全不知道这个。任何人都可以给我任何指示让我开始。



非常感谢任何能给出最微小暗示的人!



I am totally stumped with this one right now. Can anyone give me any pointers to get me started.

Many thanks to anyone who can give even the tiniest hint!

推荐答案

好吧,我不知道你要编写什么,但我认为Excel副本的标准方式是Cell.Value,你想要Excel.Formula。多数民众赞成无论如何我需要做什么,但我不知道如何按照你的指定去做。
Well, I dont know exactly what you have to write, but I think the standard way Excel copy is the Cell.Value, and you want Excel.Formula. Thats what I do when that is needed anyway, but I dont know how to do it as you have specified.


我认为你正在调用SaveAs方法,你可以参考MSDN: http:// msdn .microsoft.com / zh-cn / library / microsoft.office.tools.excel.workbook.saveas(v = vs.80).aspx [ ^ ]
I think that you are calling the SaveAs methods, there you can refer to the MSDN: http://msdn.microsoft.com/en-us/library/microsoft.office.tools.excel.workbook.saveas(v=vs.80).aspx[^]


看过这个,在网上搜索等我发现很多情况下excel以一种奇怪的,无益的方式表现。似乎建议使用变通方法而不是逻辑解决方案。因此,我将创建一个宏,这将导致在每次保存之前在电子表格上执行操作。这将确保点击和拖动操作永远不会是每次保存之前的最后一次操作。
Having looked into this, researched on the web etc I have found lots of cases where excel behaves in an odd, unhelpful manner. Workarounds seem to be suggested rather than logical solutions. So, I am going to create a macro which will cause an operation to be performed on the spreadsheet before every save. This will ensure that the click and drag operation is never the last operation before before every save.


这篇关于将单元格公式拖动到其他单元格时,Excel电子表格不会保存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆