View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default Opening a single workbook

Sub opensingleworkbook()
Workbooks.Open "C:\Documents and Settings\hprasadh\Desktop\ABC Format.xls"
End Sub


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Hari" wrote in message
...
Hi,

I have a file named "ABC format" in the location "C:\Documents and
Settings\hprasadh\Desktop".

I want to open this file automatically. I wrote (rather pinched it from NG
with some modification) the following as a module in a new workbook:-

Sub opensingleworkbook()
Workbooks("C:\Documents and Settings\hprasadh\Desktop\ABC Format").Open
End Sub

Im getting runtime error '9' : Subsript out of range.

Please tell me how to overcome the same. (The file ABC format exists)

Regards,
Hari
India