Opening a single workbook

B

Bob Phillips

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)
 
H

Hari

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
 
T

TroyW

This syntax might work better.

Troy

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

Charles

Hari,

Compair this with your code.
Workbooks.Open Filename:= _
"C:\Documents and Settings\MyName\My Documents\Odoms.xl


HTH

Charle
 
H

Hari

Thanx a lot Bob, Charles and Troy.

Im posing doubts after doubts and all of u have been very helpful in getting
me across one bridge after another safely.

Long live the Newsgroups ( I hope I learn to such a level that Im able to
answer other's doubts very soon in the future.)

Thanx again

Regards,
Hari
India
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top