A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Open Excel file with command button?



 
 
Thread Tools Display Modes
  #1  
Old May 9th, 2010, 07:29 PM posted to microsoft.public.access.gettingstarted
steve goodrich
external usenet poster
 
Posts: 132
Default Open Excel file with command button?

We have two versions of MS Office installed in our office – 97 & 2003
We use Access 97 and Excel, Word and PowerPoint 2003
The file types are associated with the correct programs, so double clicking
an Excel file for example will open it using Excel 2003.

I have an Access 97 db with a command button on the form that when clicked
opens an Excel file using the FollowHyperlink code.E.g. followhyperlink “
\\servername\shared\PUBLIC\filename.xls”

I have also tried to enter the hyperlink on the format tab on the property
sheet
On both occasions the file opens with Excel 97
Is there a method that I can use that will open the file in Excel 2003
All other files/shortcuts open with 2003 when double clicked

I tried to get Office 97 uninstalled except for Access 97 but we need photo
editor 97 and was informed by our tech guy that they can’t remove
word,excel & PowerPoint 97 and leave photo editor on because of the way our
company has it packaged. It’s all done remotely and they can’t do custom
installs/uninstalls.

All I want to do is open an Excel file using the 2003 version from a
command button on my form.

Any help would be appreciated

Steve


  #2  
Old May 9th, 2010, 09:32 PM posted to microsoft.public.access.gettingstarted
Douglas J. Steele[_3_]
external usenet poster
 
Posts: 3,143
Default Open Excel file with command button?

FollowHyperlink should open whatever application is associated with the file
extension. I'm guessing that if you double-click on the file in Windows
Explorer, Excel 97 opens as well. If that's the case, your options would
seem to be change the file association, or else use Automation to open an
instance of Excel 2003 and then load the workbook into that instance.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"Steve Goodrich" wrote in message
...
We have two versions of MS Office installed in our office – 97 & 2003
We use Access 97 and Excel, Word and PowerPoint 2003
The file types are associated with the correct programs, so double
clicking
an Excel file for example will open it using Excel 2003.

I have an Access 97 db with a command button on the form that when clicked
opens an Excel file using the FollowHyperlink code.E.g. followhyperlink “
\\servername\shared\PUBLIC\filename.xls”

I have also tried to enter the hyperlink on the format tab on the property
sheet
On both occasions the file opens with Excel 97
Is there a method that I can use that will open the file in Excel 2003
All other files/shortcuts open with 2003 when double clicked

I tried to get Office 97 uninstalled except for Access 97 but we need
photo
editor 97 and was informed by our tech guy that they can’t remove
word,excel & PowerPoint 97 and leave photo editor on because of the way
our
company has it packaged. It’s all done remotely and they can’t do custom
installs/uninstalls.

All I want to do is open an Excel file using the 2003 version from a
command button on my form.

Any help would be appreciated

Steve



  #3  
Old May 9th, 2010, 09:48 PM posted to microsoft.public.access.gettingstarted
steve goodrich
external usenet poster
 
Posts: 132
Default Open Excel file with command button?

Doug,
Thanks for your reply.
I have set my file associations so that Excel opens in 2003. Every Excel
file I click in windows explorer does open in 2003. It's when I use a
command button to open the file that it opens in 97.

How do I use automation to load Excel 2003 and then load the workbook?

Steve.

"Douglas J. Steele" wrote in message
...
FollowHyperlink should open whatever application is associated with the
file extension. I'm guessing that if you double-click on the file in
Windows Explorer, Excel 97 opens as well. If that's the case, your options
would seem to be change the file association, or else use Automation to
open an instance of Excel 2003 and then load the workbook into that
instance.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"Steve Goodrich" wrote in message
...
We have two versions of MS Office installed in our office - 97 & 2003
We use Access 97 and Excel, Word and PowerPoint 2003
The file types are associated with the correct programs, so double
clicking
an Excel file for example will open it using Excel 2003.

I have an Access 97 db with a command button on the form that when
clicked
opens an Excel file using the FollowHyperlink code.E.g. followhyperlink "
\\servername\shared\PUBLIC\filename.xls"

I have also tried to enter the hyperlink on the format tab on the
property
sheet
On both occasions the file opens with Excel 97
Is there a method that I can use that will open the file in Excel 2003
All other files/shortcuts open with 2003 when double clicked

I tried to get Office 97 uninstalled except for Access 97 but we need
photo
editor 97 and was informed by our tech guy that they can't remove
word,excel & PowerPoint 97 and leave photo editor on because of the way
our
company has it packaged. It's all done remotely and they can't do custom
installs/uninstalls.

All I want to do is open an Excel file using the 2003 version from a
command button on my form.

Any help would be appreciated

Steve





  #4  
Old May 9th, 2010, 10:35 PM posted to microsoft.public.access.gettingstarted
Douglas J. Steele[_3_]
external usenet poster
 
Posts: 3,143
Default Open Excel file with command button?

Hmm. That's odd. I thought FollowHyperlink respected the file associations.

One other thing to try before going to the trouble of using Automation. Try
the ShellExecute API, as illustrated in
http://www.mvps.org/access/api/api0018.htm at "The Access Web"

--
Doug Steele, Microsoft Access MVP
http://www.AccessMVP.com/djsteele
(no e-mails, please!)



"Steve Goodrich" wrote in message
...
Doug,
Thanks for your reply.
I have set my file associations so that Excel opens in 2003. Every Excel
file I click in windows explorer does open in 2003. It's when I use a
command button to open the file that it opens in 97.

How do I use automation to load Excel 2003 and then load the workbook?

Steve.

"Douglas J. Steele" wrote in message
...
FollowHyperlink should open whatever application is associated with the
file extension. I'm guessing that if you double-click on the file in
Windows Explorer, Excel 97 opens as well. If that's the case, your
options would seem to be change the file association, or else use
Automation to open an instance of Excel 2003 and then load the workbook
into that instance.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"Steve Goodrich" wrote in message
...
We have two versions of MS Office installed in our office - 97 & 2003
We use Access 97 and Excel, Word and PowerPoint 2003
The file types are associated with the correct programs, so double
clicking
an Excel file for example will open it using Excel 2003.

I have an Access 97 db with a command button on the form that when
clicked
opens an Excel file using the FollowHyperlink code.E.g. followhyperlink
"
\\servername\shared\PUBLIC\filename.xls"

I have also tried to enter the hyperlink on the format tab on the
property
sheet
On both occasions the file opens with Excel 97
Is there a method that I can use that will open the file in Excel 2003
All other files/shortcuts open with 2003 when double clicked

I tried to get Office 97 uninstalled except for Access 97 but we need
photo
editor 97 and was informed by our tech guy that they can't remove
word,excel & PowerPoint 97 and leave photo editor on because of the way
our
company has it packaged. It's all done remotely and they can't do custom
installs/uninstalls.

All I want to do is open an Excel file using the 2003 version from a
command button on my form.

Any help would be appreciated

Steve






  #5  
Old May 11th, 2010, 01:31 PM posted to microsoft.public.access.gettingstarted
steve goodrich
external usenet poster
 
Posts: 132
Default Open Excel file with command button?

Thanks Douglas for the advice but I'm afraid the solution is far above my
skill level at the moment
Steve
"Douglas J. Steele" wrote in message
...
Hmm. That's odd. I thought FollowHyperlink respected the file
associations.

One other thing to try before going to the trouble of using Automation.
Try the ShellExecute API, as illustrated in
http://www.mvps.org/access/api/api0018.htm at "The Access Web"

--
Doug Steele, Microsoft Access MVP
http://www.AccessMVP.com/djsteele
(no e-mails, please!)



"Steve Goodrich" wrote in message
...
Doug,
Thanks for your reply.
I have set my file associations so that Excel opens in 2003. Every Excel
file I click in windows explorer does open in 2003. It's when I use a
command button to open the file that it opens in 97.

How do I use automation to load Excel 2003 and then load the workbook?

Steve.

"Douglas J. Steele" wrote in message
...
FollowHyperlink should open whatever application is associated with the
file extension. I'm guessing that if you double-click on the file in
Windows Explorer, Excel 97 opens as well. If that's the case, your
options would seem to be change the file association, or else use
Automation to open an instance of Excel 2003 and then load the workbook
into that instance.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"Steve Goodrich" wrote in message
...
We have two versions of MS Office installed in our office - 97 & 2003
We use Access 97 and Excel, Word and PowerPoint 2003
The file types are associated with the correct programs, so double
clicking
an Excel file for example will open it using Excel 2003.

I have an Access 97 db with a command button on the form that when
clicked
opens an Excel file using the FollowHyperlink code.E.g. followhyperlink
"
\\servername\shared\PUBLIC\filename.xls"

I have also tried to enter the hyperlink on the format tab on the
property
sheet
On both occasions the file opens with Excel 97
Is there a method that I can use that will open the file in Excel 2003
All other files/shortcuts open with 2003 when double clicked

I tried to get Office 97 uninstalled except for Access 97 but we need
photo
editor 97 and was informed by our tech guy that they can't remove
word,excel & PowerPoint 97 and leave photo editor on because of the way
our
company has it packaged. It's all done remotely and they can't do
custom
installs/uninstalls.

All I want to do is open an Excel file using the 2003 version from a
command button on my form.

Any help would be appreciated

Steve








  #6  
Old May 11th, 2010, 03:34 PM posted to microsoft.public.access.gettingstarted
Douglas J. Steele[_3_]
external usenet poster
 
Posts: 3,143
Default Open Excel file with command button?

Actually, using that approach is far simpler than Automation would be!

Go into the VB Editor and create a new module (not a class module nor a
module associated with a form or report)

Copy everything between Code Start and Code End on the web page, and paste
it into the new module.

Save the module, giving it a unique name (something like mdlShellExecute
should work fine)

In your Click event, use

Call fHandleFile("\\servername\shared\PUBLIC\filename.x ls")

instead of the FollowHyperlink method.

--
Doug Steele, Microsoft Access MVP
http://www.AccessMVP.com/DJSteele
(no e-mails, please!)

"Steve Goodrich" wrote in message
...
Thanks Douglas for the advice but I'm afraid the solution is far above my
skill level at the moment
Steve
"Douglas J. Steele" wrote in message
...
Hmm. That's odd. I thought FollowHyperlink respected the file
associations.

One other thing to try before going to the trouble of using Automation.
Try the ShellExecute API, as illustrated in
http://www.mvps.org/access/api/api0018.htm at "The Access Web"

--
Doug Steele, Microsoft Access MVP
http://www.AccessMVP.com/djsteele
(no e-mails, please!)



"Steve Goodrich" wrote in message
...
Doug,
Thanks for your reply.
I have set my file associations so that Excel opens in 2003. Every Excel
file I click in windows explorer does open in 2003. It's when I use a
command button to open the file that it opens in 97.

How do I use automation to load Excel 2003 and then load the workbook?

Steve.

"Douglas J. Steele" wrote in message
...
FollowHyperlink should open whatever application is associated with the
file extension. I'm guessing that if you double-click on the file in
Windows Explorer, Excel 97 opens as well. If that's the case, your
options would seem to be change the file association, or else use
Automation to open an instance of Excel 2003 and then load the workbook
into that instance.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"Steve Goodrich" wrote in message
...
We have two versions of MS Office installed in our office - 97 & 2003
We use Access 97 and Excel, Word and PowerPoint 2003
The file types are associated with the correct programs, so double
clicking
an Excel file for example will open it using Excel 2003.

I have an Access 97 db with a command button on the form that when
clicked
opens an Excel file using the FollowHyperlink code.E.g.
followhyperlink "
\\servername\shared\PUBLIC\filename.xls"

I have also tried to enter the hyperlink on the format tab on the
property
sheet
On both occasions the file opens with Excel 97
Is there a method that I can use that will open the file in Excel 2003
All other files/shortcuts open with 2003 when double clicked

I tried to get Office 97 uninstalled except for Access 97 but we need
photo
editor 97 and was informed by our tech guy that they can't remove
word,excel & PowerPoint 97 and leave photo editor on because of the
way our
company has it packaged. It's all done remotely and they can't do
custom
installs/uninstalls.

All I want to do is open an Excel file using the 2003 version from a
command button on my form.

Any help would be appreciated

Steve










  #7  
Old May 11th, 2010, 10:41 PM posted to microsoft.public.access.gettingstarted
steve goodrich
external usenet poster
 
Posts: 132
Default Open Excel file with command button?

Thanks, I'll give it a try when I get back to the office
Steve
"Douglas J. Steele" wrote in message
...
Actually, using that approach is far simpler than Automation would be!

Go into the VB Editor and create a new module (not a class module nor a
module associated with a form or report)

Copy everything between Code Start and Code End on the web page, and paste
it into the new module.

Save the module, giving it a unique name (something like mdlShellExecute
should work fine)

In your Click event, use

Call fHandleFile("\\servername\shared\PUBLIC\filename.x ls")

instead of the FollowHyperlink method.

--
Doug Steele, Microsoft Access MVP
http://www.AccessMVP.com/DJSteele
(no e-mails, please!)

"Steve Goodrich" wrote in message
...
Thanks Douglas for the advice but I'm afraid the solution is far above my
skill level at the moment
Steve
"Douglas J. Steele" wrote in message
...
Hmm. That's odd. I thought FollowHyperlink respected the file
associations.

One other thing to try before going to the trouble of using Automation.
Try the ShellExecute API, as illustrated in
http://www.mvps.org/access/api/api0018.htm at "The Access Web"

--
Doug Steele, Microsoft Access MVP
http://www.AccessMVP.com/djsteele
(no e-mails, please!)



"Steve Goodrich" wrote in message
...
Doug,
Thanks for your reply.
I have set my file associations so that Excel opens in 2003. Every
Excel file I click in windows explorer does open in 2003. It's when I
use a command button to open the file that it opens in 97.

How do I use automation to load Excel 2003 and then load the workbook?

Steve.

"Douglas J. Steele" wrote in message
...
FollowHyperlink should open whatever application is associated with
the file extension. I'm guessing that if you double-click on the file
in Windows Explorer, Excel 97 opens as well. If that's the case, your
options would seem to be change the file association, or else use
Automation to open an instance of Excel 2003 and then load the
workbook into that instance.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"Steve Goodrich" wrote in message
...
We have two versions of MS Office installed in our office - 97 & 2003
We use Access 97 and Excel, Word and PowerPoint 2003
The file types are associated with the correct programs, so double
clicking
an Excel file for example will open it using Excel 2003.

I have an Access 97 db with a command button on the form that when
clicked
opens an Excel file using the FollowHyperlink code.E.g.
followhyperlink "
\\servername\shared\PUBLIC\filename.xls"

I have also tried to enter the hyperlink on the format tab on the
property
sheet
On both occasions the file opens with Excel 97
Is there a method that I can use that will open the file in Excel
2003
All other files/shortcuts open with 2003 when double clicked

I tried to get Office 97 uninstalled except for Access 97 but we need
photo
editor 97 and was informed by our tech guy that they can't remove
word,excel & PowerPoint 97 and leave photo editor on because of the
way our
company has it packaged. It's all done remotely and they can't do
custom
installs/uninstalls.

All I want to do is open an Excel file using the 2003 version from a
command button on my form.

Any help would be appreciated

Steve












  #8  
Old May 13th, 2010, 05:01 PM posted to microsoft.public.access.gettingstarted
steve goodrich
external usenet poster
 
Posts: 132
Default Open Excel file with command button?

Hi
Finally got it working with:

Shell """C:\Program Files\Microsoft Office\office11\excel.exe""
""\\server\shared\public\folder\file.xls""", vbMaximizedFocus

Thanks for all your help

Steve

"Steve Goodrich" wrote in message
news
Thanks, I'll give it a try when I get back to the office
Steve
"Douglas J. Steele" wrote in message
...
Actually, using that approach is far simpler than Automation would be!

Go into the VB Editor and create a new module (not a class module nor a
module associated with a form or report)

Copy everything between Code Start and Code End on the web page, and
paste it into the new module.

Save the module, giving it a unique name (something like mdlShellExecute
should work fine)

In your Click event, use

Call fHandleFile("\\servername\shared\PUBLIC\filename.x ls")

instead of the FollowHyperlink method.

--
Doug Steele, Microsoft Access MVP
http://www.AccessMVP.com/DJSteele
(no e-mails, please!)

"Steve Goodrich" wrote in message
...
Thanks Douglas for the advice but I'm afraid the solution is far above
my skill level at the moment
Steve
"Douglas J. Steele" wrote in message
...
Hmm. That's odd. I thought FollowHyperlink respected the file
associations.

One other thing to try before going to the trouble of using Automation.
Try the ShellExecute API, as illustrated in
http://www.mvps.org/access/api/api0018.htm at "The Access Web"

--
Doug Steele, Microsoft Access MVP
http://www.AccessMVP.com/djsteele
(no e-mails, please!)



"Steve Goodrich" wrote in message
...
Doug,
Thanks for your reply.
I have set my file associations so that Excel opens in 2003. Every
Excel file I click in windows explorer does open in 2003. It's when I
use a command button to open the file that it opens in 97.

How do I use automation to load Excel 2003 and then load the workbook?

Steve.

"Douglas J. Steele" wrote in
message ...
FollowHyperlink should open whatever application is associated with
the file extension. I'm guessing that if you double-click on the file
in Windows Explorer, Excel 97 opens as well. If that's the case, your
options would seem to be change the file association, or else use
Automation to open an instance of Excel 2003 and then load the
workbook into that instance.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"Steve Goodrich" wrote in message
...
We have two versions of MS Office installed in our office - 97 &
2003
We use Access 97 and Excel, Word and PowerPoint 2003
The file types are associated with the correct programs, so double
clicking
an Excel file for example will open it using Excel 2003.

I have an Access 97 db with a command button on the form that when
clicked
opens an Excel file using the FollowHyperlink code.E.g.
followhyperlink "
\\servername\shared\PUBLIC\filename.xls"

I have also tried to enter the hyperlink on the format tab on the
property
sheet
On both occasions the file opens with Excel 97
Is there a method that I can use that will open the file in Excel
2003
All other files/shortcuts open with 2003 when double clicked

I tried to get Office 97 uninstalled except for Access 97 but we
need photo
editor 97 and was informed by our tech guy that they can't remove
word,excel & PowerPoint 97 and leave photo editor on because of the
way our
company has it packaged. It's all done remotely and they can't do
custom
installs/uninstalls.

All I want to do is open an Excel file using the 2003 version from a
command button on my form.

Any help would be appreciated

Steve














  #9  
Old June 1st, 2010, 11:31 PM posted to microsoft.public.access.gettingstarted
Len[_4_]
external usenet poster
 
Posts: 1
Default Open Excel file with command button?


"Steve Goodrich" wrote in message
...
We have two versions of MS Office installed in our office - 97 & 2003
We use Access 97 and Excel, Word and PowerPoint 2003
The file types are associated with the correct programs, so double
clicking
an Excel file for example will open it using Excel 2003.

I have an Access 97 db with a command button on the form that when clicked
opens an Excel file using the FollowHyperlink code.E.g. followhyperlink "
\\servername\shared\PUBLIC\filename.xls"

I have also tried to enter the hyperlink on the format tab on the property
sheet
On both occasions the file opens with Excel 97
Is there a method that I can use that will open the file in Excel 2003
All other files/shortcuts open with 2003 when double clicked

I tried to get Office 97 uninstalled except for Access 97 but we need
photo
editor 97 and was informed by our tech guy that they can't remove
word,excel & PowerPoint 97 and leave photo editor on because of the way
our
company has it packaged. It's all done remotely and they can't do custom
installs/uninstalls.

All I want to do is open an Excel file using the 2003 version from a
command button on my form.

Any help would be appreciated

Steve


  #10  
Old February 22nd, 2011, 01:53 PM
RichardBoomhowern RichardBoomhowern is offline
Banned
 
First recorded activity by OfficeFrustration: Feb 2011
Location: USA
Posts: 13
Send a message via ICQ to RichardBoomhowern
Default

I simply passed this onto a colleague who was doing a little analysis on that
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 03:20 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.