473,382 Members | 1,180 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Opening XLS book with spaces in the title

Hi

I'm tring to open various xl books using

Attach = "" & cboAttachments.Value & ""

stAppName = "C:\Program Files\Microsoft Office\Office\EXCEL.EXE " +
Attach
Call Shell(stAppName, 1)

However, some of the sheets have spaces in the title eg "High Level
Assessment.xls"

So instead of trying to open this, it attempts to find 3 xl books
called:

"High.xls"
"Level.xls"
"Assessment.xls"

Any ideas how to get round this?
Thanks for any suggestions
Paul

Oct 31 '06 #1
2 1666
Have you tried something like this?

Dim xlApp As New Excel.Application
Dim xlWkb As Excel.Workbook

Set xlApp = New Excel.Application
Set xlWkb = xlApp.Workbooks.Open("High Level Assessment.xls", 0)
xlApp.Visible = True
xlWkb.Windows(1).Visible = True

This opens a new instance of Excel with the file named and sets the
excel application to visible.

HTH
Cyberwolf

pa************@hotmail.com wrote:
Hi

I'm tring to open various xl books using

Attach = "" & cboAttachments.Value & ""

stAppName = "C:\Program Files\Microsoft Office\Office\EXCEL.EXE " +
Attach
Call Shell(stAppName, 1)

However, some of the sheets have spaces in the title eg "High Level
Assessment.xls"

So instead of trying to open this, it attempts to find 3 xl books
called:

"High.xls"
"Level.xls"
"Assessment.xls"

Any ideas how to get round this?
Thanks for any suggestions
Paul
Oct 31 '06 #2
>Any ideas how to get round this?

The statement

Attach = "" & cboAttachments.Value & ""

simply encloses cboAttachments.Value in empty strings, and therefore is
the same as

Attach = cboAttachments.Value

I think you were trying to enclose cboAttachments.Value in
double-quotes, which would be

Attach = """" & cboAttachments.Value & """"

pa************@hotmail.com wrote:
Hi

I'm tring to open various xl books using

Attach = "" & cboAttachments.Value & ""

stAppName = "C:\Program Files\Microsoft Office\Office\EXCEL.EXE " +
Attach
Call Shell(stAppName, 1)

However, some of the sheets have spaces in the title eg "High Level
Assessment.xls"

So instead of trying to open this, it attempts to find 3 xl books
called:

"High.xls"
"Level.xls"
"Assessment.xls"

Any ideas how to get round this?
Thanks for any suggestions
Paul
Nov 1 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: David Thompson | last post by:
Looking for a book to help me develop a philosophy for building databases (particularly on MySQL). And then taking them from concept to construction. Something like.... Start by asking which...
1
by: Danny | last post by:
hi, lately i've been working on a website and i have used a bit of javascript although i'm not an expert in this mather. On the page there are 3 thumbnails and when you click on a thumbnail a...
14
by: D. Alvarado | last post by:
Hello, I am trying to open a window containing an image and I would like the image to be flush against the window -- i.e. have no padding or border. Can I make this happen with a single call to a...
4
by: Phil | last post by:
k, here is my issue.. I have BLOB data in SQL that needs to be grabbed and made into a TIF file and placed on the client (could be in temp internet dir). The reason we need it in TIF format is...
3
by: IchBin | last post by:
I am trying to pad a number with spaces to the left. I can pad it with zeros as in this code: printf("<option value='%d'>%04s %s</option>n", $row->id, $row->NumberOfQuotes,...
1
momotaro
by: momotaro | last post by:
You are to write a card catalog type definition. There are up to 1000 books, and for each one you need: Title A list of up to 5 authors Catalog number A list of up to 5 subject headings Status...
4
by: jchimanzi | last post by:
Please can someone help in correcting the following attempt of the questions below. I have included my attempt at the problem I have been asked to write class definations which does the following...
6
by: RickH | last post by:
Hello, I would like to create a user XSD data type that inherits from the w3 standard data type called ID to make sure a certain repeated element always contains distinct values. The problem is...
1
by: jrw133 | last post by:
i got this program the other day and ive just started it and i am getting some errors that i cant figure out. requirements: 1)create a clas called Book. a Book has three data members: m_title,...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.