It seems there is an issue with Object positioning property of buttons.
I created an empty xlsx file and then insert a new button into an empty sheet.
right-click the button and select the item "Format Control", and then select Properties tab.
You will see the default option for Object positioning is "Move but don't size with cells".
now change the option to the first one "Move and size with cells". save the file.
The input file is ready now. You can get it from attachments as well. It is called "Book1.xlsx".
Then execute the code below.
First of all, read the input file into a stream and then save the stream into another new file with aspose.
class Program
{
static void Main(string[] args)
{
string fileName = Path.Combine(System.IO.Path.GetTempPath(), "Book1.xlsx");
byte[] sptStream = null;
//get the file into stream
using (FileStream fileStream = new FileStream(fileName, FileMode.Open, FileAccess.Read))
{
int length = (int)fileStream.Length;
sptStream = new byte[length];
fileStream.Read(sptStream, 0, length);
fileStream.Close();
}
//save the stream into another file with Aspose
using (MemoryStream msSPT = new MemoryStream(sptStream))
{
Aspose.Cells.License license = new Aspose.Cells.License();
license.SetLicense("Aspose.Total.lic");
Workbook wbook = new Workbook(msSPT);
wbook.Save(Path.Combine(System.IO.Path.GetTempPath(), "Book2.xlsx"));
}
}
}
after the Book2.xlsx was generated. open it. you will find the Object positioning of the button has been changed from "Move and size with cells" to "Move but don't size with cells" somehow. It is very strange. This is the issue. Book2.xlsx has been attached.
But if I selected the option 2 or 3 in Book1.xlsx, the option can be persisted from Book2.xlsx. I tried this.
I am using the version 8.9.1.0. but it works fine in the version 8.3.2.1 just before we upgraded the controls. So I am assuming that the upgrade of the controls caused this issue.
Would you team fix this issue? Or could you provide a workaround for now?
thanks,