Hi everyone,

I followed (or I think I have) the advice from
http://www.mail-archive.com/python-win32@python.org/msg06368.html
but I  get an error when I am trying to Paste the values only from a
spreadsheet. I simply want to increase the date in column A by one day. To
do this, I insert a formula and then I'd like to paste the values from the
column where I inserted the formula so I can get rid of the columns I don't
need. The code works up to the last line but it errors when I issue the
PasteSpecial command. I used terms like constants.xlPasteValues in the code
to make it more comprehensible to the list. I am also aware that the use of
syntax like Range("A2:A49") is normally frowned upon but this is just a
small piece of code to show my problem.

Thanks in advance

Paolo

ws1.Columns("A:A").Insert(Shift = -4161, CopyOrigin= 0)
ws1.Range("A2").FormulaR1C1 = "=RC[1]+1"
ws1.Range("A2").AutoFill(Destination= ws1.Range("A2:A49"))
ws1.Columns("A:A").Insert(Shift = -4161, CopyOrigin= 0)
ws1.Range("B2").Copy()
ws1.Range("A2").PasteSpecial(Paste = constants.xlPasteValues, Operation =
constants.xlNone)
_______________________________________________
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to