Problem with hidden file

  • Thread starter Thread starter jim simpson
  • Start date Start date
J

jim simpson

I an using Windows 98 and Excel 2000.

Following are the first few lines of code of a program that runs at night
unattended. If "quotes.xls" happens to have been hidden when Excel was last
closed then line 3 opens it as a hidden file and this program stalls when
the code ( line 4) tries to activate one of the several sheets in the file
..
Application.DisplayAlerts = False
Application.AskToUpdateLinks = False
Workbooks.Open "d:/allyears/quotes.xls"
Worksheets("Current Quotes").Activate

I have tried to follow the "open" instruction with every version of
"visible" I can think of without success.

Can someone help me with this problem?

Thanks.

Jim
 
Hi Jim

how about adding the line
Windows("quotes.xls").Visible = True
and then just to be sure that it is activated
Workbooks("quotes.xls").activate
in after the .Open line

Cheers
JulieD
 
Dim wkbk As Workbook

Application.DisplayAlerts = False
Application.AskToUpdateLinks = False
Set wkbk = Workbooks.Open("d:\allyears\quotes.xls")

wkbk.Windows(1).Visible = True
wkbk.Activate
wkbk.Worksheets("Current Quotes").Activate

may work ok.

(I changed your slashes to backslashes--excel is forgiving, but I'm not <vbg>.)
 
Thanks to all for the help. I've screwed-up on this before. I never think of
windows as having a file name, I always think of it as a sheet name. Got to
get my thinking straight.

Jim
 
Back
Top