Aspose.cell cannot copy command button and macro code?

I use aspose.cell dll to copy a worksheet which has a command button and
associated vba code. Command button doesn’t work in the new worksheet?
Why? How can I fix that? Thanks.

Workbook wb = new Workbook(“Sample.xls”);
Worksheet sheet= wb.Worksheets[0];
sheet.Cells[“B10”].PutValue(“test”);
Worksheet cpySheet = wb.Worksheets[wb.Worksheets.AddCopy(0)];
wb.Save(“Sample.xls”);
sheet[0] has a command button and vba code, but it doesn’t work in cpySheet.

Hi,


Thanks for the sample file and code.

I can notice the issue as you have mentioned. The command cannot be clicked on the copied sheet.

I have logged a ticket with an id “CELLSNET-41356” for your issue. We will investigate your issue and get back to you soon.

Thank you.

Thanks for you quick reply.
I hope the command can be clicked and the vba also works on the copied sheet. Thanks a lot.

Amjad Sahi:
Hi,

Thanks for the sample file and code.

I can notice the issue as you have mentioned. The command cannot be clicked on the copied sheet.

I have logged a ticket with an id "CELLSNET-41356" for your issue. We will investigate your issue and get back to you soon.

Thank you.


Hi Sahi,

Is there any update on this? We are waiting this fix to release our project. Thanks.

Hi,


We are sorry for your inconvenience.

I am afraid your issue’s status is “Under Analysis”. We will try to complete the evaluation of your issue soon. Once we do it, we will update you here immediately.


Thanks,

Hi,


To update you on your issue, we have completed our investigation and analysis. We regret to tell you that we may not support it or fix your issue. The main reason is that we do not support parsing VBA codes (already logged a ticket as “CELLSNET-40353”) at the moment, so we cannot support this feature.

We are sorry for any inconvenience caused!
Amjad Sahi:
Hi,

To update you on your issue, we have completed our investigation and analysis. We regret to tell you that we may not support it or fix your issue. The main reason is that we do not support parsing VBA codes (already logged a ticket as "CELLSNET-40353") at the moment, so we cannot support this feature.

We are sorry for any inconvenience caused!


Hi Sahi,

If worksheet count is dynamical, is there any workaround to resolve this? I need all added worksheet has a command button and corresponding VBA code. Thanks.

Hi,

Thanks for your posting and using Aspose.Cells for .NET.

It seems your requirements will not be supported because Aspose.Cells cannot manipulate the VBA or macros.

Anyway, we have logged your comments in our database. Once, there is some update for you, we will let you know asap.

Hi,


After further investigation we come to conclusion and I am afraid there is no workaround in Aspose.Cells to cope with your issue at the moment.

We are sorry for your inconvenience caused!

Hi,

Using Aspose.Cells, I am trying to Create copy of a worksheet in same workbook. The source Worksheet is having a button control and a macro is assigned to this button.
When I create a copy of source work sheet, all the data and button controls are copied into second worksheet in same work book. But macro assignment is not happening for the button in second sheet. Could you please help me out on how to assign macro code to the button using Aspose.Cells for .Net.

Thanks,

Valli

Hi Valli,


Could you attach your template files and paste your sample runnable code here to reproduce the issue on our end. We will check it soon.

Also, could you try to copy the worksheet in the same workbook manually in MS Excel to check if the macro assignment is retained or not.

Thank you.

Hi Sahi,

Thanks for your quick reply.

Please find attached SampleTemplate and the code below.

string filepath = @"D:\\Aspose\\SampleTemplate.xlsm";
Workbook wb = new Workbook(filepath);
wb.Worksheets.Add("Sheet2");
wb.Worksheets["Sheet2"].Copy(wb.Worksheets["Sheet1"]);
wb.Save("D:\\Aspose\\SampleTemplate.xlsm", SaveFormat.Xlsm);

When we copied the worksheet in the same workbook manually the macro assignment is retained.

Please let me know if you need any further information.

Thanks,

Valli

Hi Valli,


Well, I have evaluated your issue a bit and found it is same as discussed in this thread above. We might not fix the issue. The main reason is we do not support parsing VBA codes (already logged a ticket as “CELLSNET-40353”) at the moment. Also, I have logged your details with your template file against the issue “CELLSNET-40353” into our database. The issue is not closed and is still open though.


If we have some update on it in the future, we will let you know here immediately.

We are sorry for any inconvenience caused!

Hi,

Thanks for your posting and using Aspose.Cells for .NET.

We have supported copying VBA code when copying a worksheet to other worksheet in
a workbook.

Please download and try this fix: Aspose.Cells for .NET v7.5.3.1.

The issues you have found earlier (filed as CELLSNET-41356) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.