View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
ekareem ekareem is offline
external usenet poster
 
Posts: 8
Default Close Worksheet and Making Worksheet Invisible - Both fail

Hi,
I use this (pardon the variable names...)

infile = "C:\Temp\Garb-Tests\Test1\solTrip.xlsx"
insheet = "Trip"
'---------------------------------------------------------------------
Set o = Workbooks.Open(infile).Worksheets(insheet)
....
Reading data from this works. However, this causes the sheet to open, but I
don't want that so I do:

o.Visible = false

When I do this, ths sheet still opens but it opens without any data!
Also, when I try to close this workbook using:

o.Close (false, false)

I get a runtime error 438 - Object does not support....

I also tried to close using this:

o.Close savechanges:=False

but that did not work either.

Any help for the close and the visible issues?

Thanks.

EK