How to use parameters with excel copy sheet

vb code:
excel.application.sheets(2).copy before:=excel.application.sheets(1)

in xojo, it doesn’t work,how to do?

Hello,

Maybe try this example code and see if it does what you want:

1 Like

And I am not sure, but I think this code only works for Windows systems?

I wonder if it is possible to work on Windows-hosted web apps?

Here is the docs page for ExcelApplication - https://documentation.xojo.com/api/windows/excelapplication.html

Hi Amy,
Quite a while ago (maybe 2010 or so, ish?), the code would have worked in Mac and Windows Operating Systems. I am not sure exactly what happened but the VBA code only executes on Windows. I think this was a Windows decision and I am not sure why.

I believe (?) that the code can work on Windows-hosted apps, and it seems that the hosted server machine would need to have a local version of Excel installed. I don’t believe that the app would be able to work over the internet though, just on the local server. I don’t believe that Xojo’s plugin works with Excel 365 on the cloud though.

Warm regards.

There were 1 or 2 versions where VBA didn’t work on macOS. However, Microsoft added it back in 2019 I think. The editor looks like 20 years ago, but it works:

Thank you very much,it’s what i want