Open Non-Excel file

J

Jos Vens

Hi,

can you tell me how to open a non-excel file from within Excel

eg. a .txt-file or what I want to do is running an access database .mdb file

the shell-option does not work since it are not applications but documents.

Thanks
Jos Vens
 
G

Guest

Jos Vens said:
Hi,

can you tell me how to open a non-excel file from within Excel

eg. a .txt-file or what I want to do is running an access database .mdb file

the shell-option does not work since it are not applications but documents.

Thanks
Jos Vens

In Excel 2000 select Data>Get External Data then choose the data type from
the dialog. I expect the method is similar for other versions
 
J

Jos Vens

Hi,

I don't want to import data in Excel, I want to start a whole
access-application (not compiled, just a mdb-file). I'd like to open the
document "lvs.mdb", rather than to open first access (shell-function), then
open the .mdb file from within access.

I do not want to import data from the .mdb file into excel!

Jos
 
N

NickHK

Jos,
Well, you cannot open an .mdb file in Excel.

If you mean to open an .mdb file from Excel, then you can still use Shell,
with the command line argument set to the file and optionally username,
password, workgroup mdb etc

NickHK
 
J

Jos Vens

I guess you mean I have to open access with the shell-function and give the
argument of the filename I want to open (eg. c:\lvs.mdb).

Is there a means to know the fullname (path) of Access.exe?

Thanks for your reply
Jos
 
R

Robert Bruce

Roedd said:
I guess you mean I have to open access with the shell-function and
give the argument of the filename I want to open (eg. c:\lvs.mdb).

Is there a means to know the fullname (path) of Access.exe?

If you use the shellexecute API you don't need to know anything about the
app:

Private Declare Function ShellExecute Lib "shell32.dll" Alias
"ShellExecuteA" _
(ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As
String, _
ByVal lpParameters As String, ByVal lpDirectory As String, _
ByVal nShowCmd As Long) As Long

'Open the default program for sending email messages
Sub OpenFileInDefaultApp(FullName As String)
ShellExecute 0, vbNullString, FullName, 0&, 0&, 1
End Sub

Sub test()
OpenFileInDefaultApp "C:\odbcconf.log"
End Sub

--
Rob

http://www.asta51.dsl.pipex.com/webcam/

This message is copyright Robert Bruce and intended
for distribution only via NNTP.
Dissemination via third party Web forums with the
exception of Google Groups and Microsoft Communities
is strictly prohibited and may result in legal action.
 
R

Robert Bruce

Roedd <<Robert Bruce>> wedi ysgrifennu:

Ignore this comment. I forgot to delete it when i
adjusted the example to better meet the question.
'Open the default program for sending email messages

--
Rob

http://www.asta51.dsl.pipex.com/webcam/

This message is copyright Robert Bruce and intended
for distribution only via NNTP.
Dissemination via third party Web forums with the
exception of Google Groups and Microsoft Communities
is strictly prohibited and may result in legal action.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top