一级方程式(潮石)问题
在工作中,我们一直坚持使用一级方程式 Excel 组件。问题是我找不到任何地方可以发布问题,所以我想我在这里试试。
我想要实现的目标是将工作簿读成工作表。我有多个 vts 工作簿,每个工作簿由一张纸组成,我想将它们读入一本包含多张纸的工作簿。我发现采用 vts 文件名的唯一方法是 Read 和 ReadEx 方法,但是这些方法不允许我读取单个工作表并将其添加到现有工作簿中。
这是我用来读取工作簿的代码:
TTF160.AxTTF160.AxF1Book book = new AxF1Book();
book.ReadEx("book1.vts");
book.ReadEx("book2.vts");
但是第二个读取语句替换了整个工作簿。有没有办法将第二个工作簿添加为工作表?
At work we're stuck with using Formula One Excel components. The problem is that I can't find anywhere to post questions so I thought I try here.
What I'm trying to achieve is reading workbooks into sheets. I have multiple vts workbooks that consist of one sheet each and I would like to read them into one workbook with multiple sheets. The only methods i found that takes a vts file name is the Read and ReadEx methods, however those methods only would not allow me to read a single sheet and add it to an existing workbook.
This is the code that I'm using to read a workbook:
TTF160.AxTTF160.AxF1Book book = new AxF1Book();
book.ReadEx("book1.vts");
book.ReadEx("book2.vts");
But the second read statement replaces the whole workbook. Is there a way to add the second workbook as a worksheet?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否研究过是否可以将每个文件读入其自己的 AxF1Book 对象中。然后将工作表从一张复制到另一张?如果我没记错的话,您可能需要将这些 Book 对象放入 WorkbookGroup 中,以便它们可以彼此“看到”。
Have you investigated whether you can read each file into its own AxF1Book object. Then copy the sheet from one to the other? If I remember correctly, you may need to put those Book objects into a WorkbookGroup so that they can 'see' each other.