View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Haldun Alay[_4_] Haldun Alay[_4_] is offline
external usenet poster
 
Posts: 7
Default Excel VBA basics

Hi,
Try


.......
Set myBook = ActiveWorkbook
........


Kind Regards.
--
Haldun Alay
"Philipp" , haber iletisinde sunlari ...
Hello,
I wonder why the following Excel VBA code does not work.

Sub test()
Dim myBook As Workbook
myBook = ActiveWorkbook
Debug.Print "the book name is" & myBook.Name
End Sub

Is it not possible to assign the reference to the workbook to a variable?
Thanks for answers Phil