Delphi вики
Advertisement

http://sirexcel.ru/makrosi_vba/kak_skopirovat_dannie_iz_odnoi_knigi_v_druguyu/

открытие книги

Дирректория папки данной книги
ThisWorkbook.Path

Workbooks.Open Filename:=ThisWorkbook.Path & "\" & "Name.xlsx"


Проверка, открыта ли книга

If IsBookOpen("Name.xlsx") Then


Function IsBookOpen(wbName As String) As Boolean
   Dim wbBook As Workbook
   For Each wbBook In Workbooks
       If wbBook.Name <> ThisWorkbook.Name Then
           If Windows(wbBook.Name).Visible Then
               If wbBook.Name = wbName Then IsBookOpen = True: Exit For
           End If
       End If
   Next wbBook
End Function
Advertisement