VSTO:use C# to record user actions and implement recall function

23 views Asked by At

I want to record user's actions to the cell't value and style(bg color、font color、font size...)to implement recall function,I tried two methods but doesn't work.Please give me some advice.

  1. use Copy:
Excel.Range top = worksheet.get_Range("A1:B1");
Excel.Range down = worksheet.get_Range("A2:B2");

top.Copy(down);

It works but I can't manually create a new Range object, use a Range in user's worksheet is not good for me.

2.set style for Range:

Excel.Range top = worksheet.get_Range("A1:B1");
Excel.Range down = worksheet.get_Range("A2:B2");
down.Value= top.Value;
down.Style = top.Style;

it doesn't work for style.

0

There are 0 answers