Help Me!!!!!!!!!

  • Thread starter Achit via AccessMonster.com
  • Start date
A

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)

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??
??
 
F

fredg

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??
??

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"
 
D

Dirk Goldgar

Achit via AccessMonster.com said:
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??
??


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.
 
R

Ryan Penter

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
 
J

John Spencer

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
 

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