PDA

View Full Version : Solved: opening excel file using VBA



maddiashok
05-10-2010, 11:49 PM
Hi Friends,
I am New to VBA.

I have a query.
I am trying to open an excel file using VBA.
Excel file is in server.
am writting following code

Sub openworkbook()
Workbooks.Open Filename:="\\server\exc\book1.xls "
End Sub

but am not able to open excel file.

Please help me in this issue.

Thanks in Advance

p45cal
05-11-2010, 12:01 AM
it wouldn't be that extra space at the end of:
Filename:="\\server\exc\book1.xls "
would it?

maddiashok
05-11-2010, 12:07 AM
Hi,
Thanks for reply.
Actually there is no space. I tried it.
i kept exc folder also in shared mode...

p45cal
05-11-2010, 12:38 AM
what's the error message?

maddiashok
05-11-2010, 12:42 AM
\\server\exc\book1.xls cannot be found. Check your spelling, or try a different path.

I already checked spellings

Thanku!

maddiashok
05-11-2010, 01:02 AM
Hi,
My issue has been solved.
The problem is with Sharing Permissions.
Thanku!

rbrhodes
05-11-2010, 08:02 PM
mark it 'Solved' pls