Discussion:
Help Me!!!!!!!!!
(too old to reply)
Achit via AccessMonster.com
2010-04-29 07:50:21 UTC
Permalink
I Have 2 question
1.I want maximize view of form, when I move to another computer, the view of
form not flexible, it means on computer A the view is normal(maximize), but
on computer B the view is mess.What should I do????

2.How to open excel files using command button on access vba.
I have syntax
Dim stAppName as string

stAppName="Excel.exe C:\Myspreedsheet.xls"
Call shell(stAppName, vbMaximizedFocus)

it works but When I use:
stAppName="Excel.exe C:\Audit\Myspreedsheet.xls"
it doesn't work..What should I do if I want open file in folder or subfolder??
??
--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-gettingstarted/201004/1
fredg
2010-04-29 17:07:12 UTC
Permalink
Post by Achit via AccessMonster.com
I Have 2 question
1.I want maximize view of form, when I move to another computer, the view of
form not flexible, it means on computer A the view is normal(maximize), but
on computer B the view is mess.What should I do????
2.How to open excel files using command button on access vba.
I have syntax
Dim stAppName as string
stAppName="Excel.exe C:\Myspreedsheet.xls"
Call shell(stAppName, vbMaximizedFocus)
stAppName="Excel.exe C:\Audit\Myspreedsheet.xls"
it doesn't work..What should I do if I want open file in folder or subfolder??
??
Is the file name Myspreedsheet or Myspreadsheet?
Make sure you've spelled it correctly.
Is it in a Folder named "Audit"?
Assuming the file is actually named MySpreadsheet, why not simply use:

Application.FollowHyperlink "c:\Audit\MySpreadsheet.xls"
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
Dirk Goldgar
2010-04-29 17:43:30 UTC
Permalink
Post by Achit via AccessMonster.com
I Have 2 question
1.I want maximize view of form, when I move to another computer, the view of
form not flexible, it means on computer A the view is normal(maximize), but
on computer B the view is mess.What should I do????
2.How to open excel files using command button on access vba.
I have syntax
Dim stAppName as string
stAppName="Excel.exe C:\Myspreedsheet.xls"
Call shell(stAppName, vbMaximizedFocus)
stAppName="Excel.exe C:\Audit\Myspreedsheet.xls"
it doesn't work..What should I do if I want open file in folder or subfolder??
??
1. You need to give a more full description of what you mean. I can't make
sense of it.

2. There are two possibilities: (a) you misspelled something, or (b) the
path you posted isn't the real path, and the real path contains spaces. If
the path contains spaces, you need to enclose it in quotes *within* the
string you pass to Shell. For example:

stAppName="Excel.exe ""C:\Path With Spaces\Myspreedsheet.xls"""

By doubling up the quotes in the quotes string, one quote is embedded.

Off-topic Comment:
The subject line of your post is uninformative and annoying. Most people
posting want help. Adding exclamation points doesnt make your post more
deserving than others'. A subject line summarizing the problem or topic is
much more useful.
--
Dirk Goldgar, MS Access MVP
Access tips: www.datagnostics.com/tips.html

(please reply to the newsgroup)
Ryan Penter
2010-11-04 10:27:38 UTC
Permalink
Hi,
This post was really useful, my Access Form now works really well. However, to make it bullet-proof, I need to tweak it slightly so that if the user inputs a filepath that contains spaces the database can still cope. Can you help?

My code is like this...
________________________________________________________
Dim FileName As String
FileName = InputBox "Enter filepath","","c:\Dashboards\")

stAPPName = "excel.exe " & FileName & "Programme_Dashboard.xlsx"
Call Shell(stAPPName,1)
________________________________________________________

Can you tweak it slightly so that if they input C:\Documents and Settings\ into the inputbox it still works?

Many thanks in anticipation!
Ryan
Post by Achit via AccessMonster.com
I Have 2 question
1.I want maximize view of form, when I move to another computer, the view of
form not flexible, it means on computer A the view is normal(maximize), but
on computer B the view is mess.What should I do????
2.How to open excel files using command button on access vba.
I have syntax
Dim stAppName as string
stAppName="Excel.exe C:\Myspreedsheet.xls"
Call shell(stAppName, vbMaximizedFocus)
stAppName="Excel.exe C:\Audit\Myspreedsheet.xls"
it does not work..What should I do if I want open file in folder or subfolder??
??
--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-gettingstarted/201004/1
Post by fredg
Is the file name Myspreedsheet or Myspreadsheet?
Make sure you have spelled it correctly.
Is it in a Folder named "Audit"?
Application.FollowHyperlink "c:\Audit\MySpreadsheet.xls"
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
1. You need to give a more full description of what you mean. I cannot make
sense of it.
2. There are two possibilities: (a) you misspelled something, or (b) the
path you posted is not the real path, and the real path contains spaces. If
the path contains spaces, you need to enclose it in quotes *within* the
stAppName="Excel.exe ""C:\Path With Spaces\Myspreedsheet.xls"""
By doubling up the quotes in the quotes string, one quote is embedded.
The subject line of your post is uninformative and annoying. Most people
posting want help. Adding exclamation points doesnt make your post more
deserving than others'. A subject line summarizing the problem or topic is
much more useful.
--
Dirk Goldgar, MS Access MVP
Access tips: www.datagnostics.com/tips.html
(please reply to the newsgroup)
Submitted via EggHeadCafe - Software Developer Portal of Choice
Styling the WPF ScrollViewer
http://www.eggheadcafe.com/tutorials/aspnet/f51ddf8c-5227-4f1b-a5df-ec3d1b3439ca/styling-the-wpf-scrollviewer.aspx
John Spencer
2010-11-04 13:17:04 UTC
Permalink
Not sure but try adding quotes around the full path.

stAPPName = "excel.exe " & Chr(34) & FileName & "Programme_Dashboard.xlsx" &
Chr(34)

or do the same thing this way.
stAPPName = "excel.exe """ & FileName & "Programme_Dashboard.xlsx"""


John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County
stAPPName = "excel.exe "& FileName& "Programme_Dashboard.xlsx"
Loading...