473,466 Members | 1,294 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

open excel file

Hi i am trying to open an excel file from access using a button

the problem is the path and could change so i need to build the path to
the file
i am using textboxes to hold the information as it builds
ie first part of the path C:\Temp
second part of the path kevin carter
third part of the path Folder name
and then the file name

i am then concanting this information into a text box which gives me
the full path
ie C:\Temp\kevin carter\Folder name\ *********.xls

How can i use the text box to open the file?

or is there an easier way ?
thanks

kevin

Dec 16 '05 #1
2 3607
Kevin:

First, to answer your question, I suggest you use this code:

Dim sPath As String
sPath = Nz(Me.txtPathToFile, "")
If Dir(sPath) <> "" Then Application.FollowHyperlink sPath
Now, a bit of housekeeping ...

I noticed that you posted your question back as a response to your question.
This phenomenon happens way more often than I can explain, and maybe it
has something to do with some quality of the newsreader you use or some other
factor completely out of your control, but I finally feel compelled to offer
an unsolicited word of advice:
Try not to post back to your own question.

It's really self defeating. I can't speak for everryone who reads newsgroups,
but I know that I pay special attention to posts with no replies. That means
they are either new or no one has come up with a response and are in special
need of attention. By posting a reply to your own question, you flag yours as
"answered" already, when in fact it isn't. That can't help your cause.

I use the pronoun "you" here but it's not just you, of course, who does this.
Maybe I just don't understand what's happening here, but it strikes me that
people are going out of their way to post, double post, up post, down post
side post, reverse post ... post post post post post. A single post is usually all
that's required to get our attention.
--

Danny J. Lesandrini
dl*********@hotmail.com
http://amazecreations.com/datafast/


Dec 16 '05 #2
On 15 Dec 2005 23:16:21 -0800, "kevcar40" <ke******@btinternet.com>
wrote:

It might be easier to offer the user a File/Open dialog. Study this
much-quoted page: http://www.mvps.org/access/api/api0001.htm

What do you want to do with the Excel file after you open it?
If nothing else, you could use the Shell command, or a bit more fancy,
the ShellExecute API.

-Tom.

Hi i am trying to open an excel file from access using a button

the problem is the path and could change so i need to build the path to
the file
i am using textboxes to hold the information as it builds
ie first part of the path C:\Temp
second part of the path kevin carter
third part of the path Folder name
and then the file name

i am then concanting this information into a text box which gives me
the full path
ie C:\Temp\kevin carter\Folder name\ *********.xls

How can i use the text box to open the file?

or is there an easier way ?
thanks

kevin


Dec 16 '05 #3

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

Similar topics

13
by: Allison Bailey | last post by:
Hi Folks, I'm a brand new Python programmer, so please point me in the right direction if this is not the best forum for this question.... I would like to open an existing MS Excel spreadsheet...
1
by: Lize | last post by:
Hi, I'm writing an ASP application to open an excel workbook, then run a macro stored in the excel file, which produces outputs that will be displayed back onto my ASP application. Now the...
1
by: Sarah | last post by:
Hello. I am using Microsoft.Office.Interop.Excel in a C# .NET project. I want to open an Excel application with a specific file name. I am currently opening it with this code: ...
2
by: zino | last post by:
I have a file that is created in Excel and saved as an htm file. (if I open the file through Excel it open as Excel file, if I click on the file name it open in internet explorer). I need to...
3
by: VbUser25 | last post by:
hi.. i have a form i accept some user inputs in the form. there is a link on the form from where i open the excel file in the same browser (not in a new page...simply using a href. i am also...
3
by: Jennyfer Barco | last post by:
Hello, I have a question, how can I open Microsoft Excel from .NET. I only need to open a new file in Excel and paste some information and set the Microsoft Excel as the enabled aplication, so the...
4
by: JaxDawg | last post by:
I have a spreadsheet saved as an XML spreadsheet so I can manipulate it easier (and don't need COM). When I'm done, I want to display to the user. Currently, I'm using simple JavaScript in my PHP...
8
by: shenkel55 | last post by:
I'm using Access and Excel 2003. Using either the import wizard or code, I have the same problem. This problem only happens with Excel files automatically generated by Corp IT. If I try to do an...
7
by: Peter | last post by:
ASP.NET 2.0 I am trying to open a Word document and Excel document from a dialog web page, what's the best way to do that? I have tried the following: Response.Clear();...
22
by: robertgregson | last post by:
Using C#, .NET3.5, Visual Studio 2008 and WCF on Windows VISTA SP1, I have written a service, service host (as a C# console application) and a client. The service uses...
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.