473,407 Members | 2,320 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,407 software developers and data experts.

open excel file automaticallty via access btn

hi i am trying to open a excel spreadsheet automatically at the push of a button. i am using the below code that i obtained via another help message but i keep getting an error message saying 'runtime error 5, invalid procedure or call arguement???

can someone help me out?

Private Sub cmdOpenExcelFile_Click()
Dim stAppName As String

stAppName = "h:\sue\bdrm\FBT Fleet\access\FBTDataFleetCollection.xls"

Call Shell(stAppName, 1)

End Sub
Feb 13 '08 #1
2 4026
Jim Doherty
897 Expert 512MB
Try the application.followhyperlink method instead

Expand|Select|Wrap|Line Numbers
  1.  
  2. Dim stAppName as string
  3. stAppName = "h:\sue\bdrm\FBT Fleet\access\FBTDataFleetCollection.xls"
  4. application.FollowHyperlink stAppName
  5.  
Regards

Jim
Feb 13 '08 #2
Stewart Ross
2,545 Expert Mod 2GB
hi i am trying to open a excel spreadsheet automatically at the push of a button. i am using the below code that i obtained via another help message but i keep getting an error message saying 'runtime error 5, invalid procedure or call arguement???

can someone help me out?

Private Sub cmdOpenExcelFile_Click()
Dim stAppName As String

stAppName = "h:\sue\bdrm\FBT Fleet\access\FBTDataFleetCollection.xls"

Call Shell(stAppName, 1)

End Sub
Hi. Shell needs to know what application to launch - try this in place of your Call statement

Expand|Select|Wrap|Line Numbers
  1. Call Shell ("Excel " & stAppName, 1)
It works for me.

Cheers

Stewart
Feb 13 '08 #3

Sign in to post your reply or Sign up for a free account.

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...
115
by: TheAd | last post by:
At this moment I use MsAccess and i can build about every databound application i want. Who knows about a serious open source alternative? Because Windows will be a client platform for some time, i...
2
by: JM | last post by:
Hi I have been trying to open Excel 2003 but I am having rotten luck. Just can't see to get it working. I looked at this article... ...
2
by: kevcar40 | last post by:
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...
0
by: shaurya.rastogi | last post by:
I need to open an Excel file that has been stored in the Access Database using the insert Object functionality of MSAccess manually. What i am aware of is that i cant just read the field...
0
by: shaurya | last post by:
I need to open an Excel file that has been stored in the Access Database using the insert Object functionality of MSAccess manually. What i am aware of is that i cant just read the field...
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...
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...
4
by: mld01s | last post by:
Hi all!! I need help, I have been stuck for a few days on this one. I am trying to open an excel table from a command button in Access. The excel table has an auto_open macro, that is supposed to...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.