ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Opening a single workbook (https://www.excelbanter.com/excel-programming/300979-opening-single-workbook.html)

Bob Phillips[_6_]

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






Hari[_3_]

Opening a single workbook
 
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




TroyW[_2_]

Opening a single workbook
 
This syntax might work better.

Troy

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


"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






Charles

Opening a single workbook
 
Hari,

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


HTH

Charle

--
Message posted from http://www.ExcelForum.com


Hari[_3_]

Opening a single workbook
 
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


"Charles " wrote in message
...
Hari,

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


HTH

Charles


---
Message posted from http://www.ExcelForum.com/





All times are GMT +1. The time now is 05:54 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com