View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
1tsols[_3_] 1tsols[_3_] is offline
external usenet poster
 
Posts: 1
Default Help: Can open a spreadsheet in a folder which contains spaces in the folder name!


Tim Williams Wrote:
What is "IsFile" ?

--
Tim Williams
Palo Alto, CA


"1tsols" wrote i
message
...

Hello, I am new to this forum, so hello to everyone, nice to b

here!

I have a project that I am developing in Visual Basic 6 and part o

the
project requires opening, modifying and close a excel spreadsheet. I
have the code and in general works fine and without problems.

However one problem has arisen, when I try and open a exce

spreadsheet
that is in a folder that contains a space in the folder name, i

won't
open the spreadsheet. I have included the code below


Code:
--------------------
Dim oExcel As New Excel.Application
Dim oWorkBook As Excel.Workbook

' before we can do anything, we need to check the excel fil

exists
If IsFile(sExcelFile) Then
' excel file exists, proceed and open it
oExcel.Workbooks.Open FileName:=sExcelFile

' do what i have to do.......

oExcel.ActiveWorkbook.Save
oExcel.Quit
End If
--------------------


I have tried to enclosed file name in quotes and that doesn't work


--
1tsols


------------------------------------------------------------------------
1tsols's Profile

http://www.excelforum.com/member.php...o&userid=36430
View this thread

http://www.excelforum.com/showthread...hreadid=561976


IsFile() is a generic routine to check that the file exists befor
attempting to open the file with excel.

To Dave Williamson:
I do pass the full path and filename to excel eg. "C:\Documents an
Settings\JHP\My Documents\excel.xls".

I will try your suggestions tomorrow when I'm back at work.

Thank

--
1tsol
-----------------------------------------------------------------------
1tsols's Profile: http://www.excelforum.com/member.php...fo&userid=3643
View this thread: http://www.excelforum.com/showthread.php?threadid=56197