另一个PythonWin Excel问题 [英] Another PythonWin Excel question

查看:71
本文介绍了另一个PythonWin Excel问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我按照
中的示例 http:// stompstompstomp.com/weblog/technical/2004-05-20 并了解到要将一个新的工作表添加到Excel工作簿,你将使用

workbook.Worksheets.Add()方法。这样可行。但是,新工作表

在我最后一张工作表的前面加了*。我如何才能获得

在*之后添加*?


谢谢,


-


I followed the example in
http://stompstompstomp.com/weblog/technical/2004-05-20 and learned that to
add a new worksheet to an Excel workbook, you would use the
workbook.Worksheets.Add() method. That works. However, the new worksheet
got added *in front* of the last worksheet I was at. How can I get it to
add *after*?

Thanks,

--
Me

推荐答案

我不确定这个,但我相信你可以给出一个参数

之后= QUOT;工作表Sheet" ;.添加(),像这样,添加(在= ='sheet1")之后。


不幸的是我没有在这台机器上安装Excel来确认

这个。


提示:如果你安装了VBA(如果你有Excel就应该这样),

查找Worksheets集合的Add方法。 VBA将显示

代码完成,以及方法调用的所有参数。对于任何一种方法都可以尝试




谢谢,

--Kartic

I am not sure about this but I believe you can give a parameter
after="sheet1". to Add(), like so, Add(after="sheet1").

Unfortunately I do not have Excel installed on this machine to confirm
this.

A tip: if you have VBA (which you should if you have Excel) installed,
lookup the Add method for the Worksheets collection. VBA will show the
code completion, with all the arguments for the method call. Try the
same for any of the methods.

Thanks,
--Kartic




" Kartic" < KA ****************** @ gmail.com>在消息中写道

news:11 ********************** @ f14g2000cwb.googlegr oups.com ...

"Kartic" <ka******************@gmail.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
我不确定这一点,但我相信你可以在=" sheet1"之后给出一个参数
。添加(),像这样,添加(在= ='sheet1")之后。


我在'''后得到一个得到一个预期的关键字参数''来自Add()。

不幸的是我没有在这台机器上安装Excel来确认这个。

提示:如果你有VBA(你应该如果安装了Excel),则查找Worksheets集合的Add方法。 VBA将显示
代码完成,以及方法调用的所有参数。对于任何一种方法都可以尝试相同的



是的,我读过这个但不幸的是我没有VBA *的经验

all *。 :=(

谢谢,
--Kartic
I am not sure about this but I believe you can give a parameter
after="sheet1". to Add(), like so, Add(after="sheet1").

I get a "got an expected keyword argument ''after''" from Add().
Unfortunately I do not have Excel installed on this machine to confirm
this.

A tip: if you have VBA (which you should if you have Excel) installed,
lookup the Add method for the Worksheets collection. VBA will show the
code completion, with all the arguments for the method call. Try the
same for any of the methods.

Yes, I read about that but unfortunately I have no experience with VBA *at
all*. :=(
Thanks,
--Kartic



对不起,我在考虑move()方法。Move()接受after =

参数。


请参阅此链接以了解用法。(左侧导航栏包含

工作表集合,请将此页面加入书签:-)

http://msdn.microsoft.com/library/de...oworkbooks.asp

谢谢

Sorry, I was thinking of the move() method. Move() takes the after=
argument.

See this link for usage. (The left nav bar has all other method of the
worksheets collection, so bookmark this page :-)

http://msdn.microsoft.com/library/de...oworkbooks.asp
Thanks


这篇关于另一个PythonWin Excel问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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