View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
NickHK NickHK is offline
external usenet poster
 
Posts: 4,391
Default vb.net calling worksheet by name

Barnie,
Don't know about .Net, but VB/VBA would require a Workbook object, not just
the word "workbook", or use 'ThisWorkbook". And the use of "Set", because
the variables are objects.
Dim WB as Workbook
Dim MyWorkSheet as Worksheet

Set WB=Workbooks.Add
Set Myworksheet =WB.Worksheets("Sheet3")

NickHk

"Barnie" wrote in message
...
Hi all,
Does any one know how to call a spread sheet by name?

I tried

Myworksheet = workbook.worksheets("Sheet3")

But that doesn't work. Everything else on my code is working fine except
that. Am I missing anything?

Thank you!


Barnabas (Barnie) Yohannes
http://www.geocities.com/barnabas_yohannes
"So powerful is the light of unity that it can illuminate the whole earth"