Notice: Undefined offset: 2 in /home2/icentarb/public_html/icentar/classes/class.permissions.php on line 735
Option Explicit Function Kopiraj() Dim ObEx As Excel.Application Dim Vork As Excel.Workbook, VorkN As Excel.Workbook Dim ExSit As Excel.Worksheet, ExSitN As Excel.Worksheet Dim excelFile, DirF As String, Filename As String, Putanja As String Dim f As Integer, I As Integer excelFile = Array("knjiga1.xlms", "knjiga2.xlms", "knjiga3.xlms") DirF = "c:\excelFile\" Putanja = DirF & "Zbirna.xlms" Set ObEx = New Excel.Application Set VorkN = ObEx.Workbooks.Add VorkN.SaveAs Putanja For f = 0 To UBound(excelFile) Filename = Dir(DirF & excelFile(f)) If Filename <> "" Then Putanja = DirF & Filename Set Vork = ObEx.Workbooks.Open(Putanja) For Each ExSit In Vork.Sheets I = I + 1 ExSit.Copy VorkN.Sheet