ben C# çevirmek için çalışıyorum bir Excel Makro var, ama ben bu bölümü çevirmek nasıl bilmiyorum için Makro Excel: Bazı yöntemler denediEşdeğer C#
Dim Files As Variant
Dim glos As Integer
Dim Sheet1 As Object
Dim Un As Workbook
Files = Application.GetOpenFilename("Excel Files (*.xlsx), *.xlsx", 2, "Open Files", , True)
If IsArray(Files) Then
'Something with some data
For y = LBound(Files) To UBound(Files)
Workbooks.Open Files(y)
b = ActiveWorkbook.Name
glos = glos + 1
For Each Sheet1 In ActiveWorkbook.Sheets
Sheet1.Copy after:= Un.Sheets(Un.Sheets.Count)
Next
Workbooks(b).Close False
Next
End IF
ama gelmez 't iş, iyi şimdiye kadar C# bu kadar: Ben C# benim çalışmalarında kullanan bazı makro çeviri becerilerimi geliştirmek için çalışıyorlar
var excelApp = new Excel.Application();
Excel.Workbook oWB = excelApp.Workbooks.Add(Type.Missing);
dynamic Files = oWb.Application.GetOpenFilename("Excel Files (*.xlsx), *.xlsx", 2, "Select Files", Type.Missing, true);
if (Files is Array)
{
//Something with some data
Array ar = (Array)((object)Files);
for(int y = ar.GetLowerBound(1); y < ar.GetUpperBound(1); y++)
{
oWB.Application.Workbooks.Open(ar[y]);
b = excelApp.ActiveWorkbook.Name;
glos += 1;
foreach(Excel.Sheets Sheet1 in excelApp.ActiveWorkbook.Sheets)
{
Sheet1.Copy(After: Un.Sheets[Un.Sheets.Count]);
}
ExcelApp.Workbooks[b].Close(false);
}
}
ama bu birinde takılıp, üzgünüm Kötü ingilizce, hala dili öğreniyorum.
Önceden teşekkür ederiz.
"Bu çalışmıyor" kullanılarak ele alınabilir bir sorun ifadesi değildir. Herhangi bir hata mesajı alıyor musunuz? Onlar neler? Bu hata mesajlarını hangi satırda alıyorsunuz? –
evet, sen, üzgünüm, kod hatası – MeLop
kod satırı "türü 'Dizi' ifadesi için [] ile indenxing uygulanamıyor" doğru yakalayacağız? –