LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Help: Can open a spreadsheet in a folder which contains spaces in the folder name!


Hello, I am new to this forum, so hello to everyone, nice to be here!

I have a project that I am developing in Visual Basic 6 and part of 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 excel spreadsheet
that is in a folder that contains a space in the folder name, it 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 file 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

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pulling pdf files from general folder to specific folder [email protected] Excel Discussion (Misc queries) 2 September 8th 09 09:41 PM
How to decide folder-depth or How to select more folders/subfolders (folder-tree) ? Subteam Excel Discussion (Misc queries) 2 May 7th 06 08:14 PM
how can I specific a folder with wildcard criteria and excel will import all the correct files in that folder? Raven Excel Discussion (Misc queries) 1 January 24th 06 03:28 PM
how can I specific a folder with wildcard criteria and excel will import all the correct files in that folder? Raven[_2_] Excel Programming 1 January 24th 06 04:23 AM
open file from folder save in new folder tim64[_3_] Excel Programming 20 June 17th 05 07:58 PM


All times are GMT +1. The time now is 01:32 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"