Re: starting another program



Try adding single quotes

Shell ("c:\windows\notepad.exe '" & strImport & "'")

If you aren't using Windows 9x or Millenium, then Windows should probably be
Winnt

--
Regards,
Tom Ogilvy

"Alvin Hansen" <AlvinHansen@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:0B638A82-97C5-4017-A02E-CFC52AED8EFB@xxxxxxxxxxxxxxxx
> Thanks tom I have try this
> Private Sub Command1_Click()
> On Error GoTo E_Handle
> Dim strImport As String
> Dim lngChars As Long
> Dim intFile As Integer
> intFile = FreeFile
> Open "C:\alm.txt" For Input As intFile
> lngChars = LOF(intFile)
> strImport = Input(lngChars, intFile)
> Shell ("c:\windows\notepad.exe " & strImport)
>
>
> sExit:
> On Error Resume Next
> Reset
> Exit Sub
> E_Handle:
> MsgBox Err.Description, vbOKOnly + vbCritical, "Error: " & Err.Number
> Resume sExit
>
>
>
>
> End Sub
>
> If i use a msgbox i can see the file is ok
> but in Shell command i get a error what do i wrong here
>
> regards
>
> alvin
>
>
>
> "Tom Ogilvy" wrote:
>
> > You can open a text file with low level io and extract the file name:
> >
> > http://www.applecore99.com/gen/gen029.asp
> > File I/O Using VBA
> > Applecore pages on Microsoft Access
> >
> >
http://support.microsoft.com/default.aspx?scid=kb;en-us;151262&Product=xlw
> > Working with Sequential Access Files
> >
> >
> > then construct a string which forms a proper argument to the shell
command.
> >
> > You can also manipulate Access using OLE Automation. You might look at
the
> > Automation help file:
> > http://support.microsoft.com/?kbid=167223
> > OFF97: Microsoft Office 97 Automation Help File Available
> >
> >
> >
> > --
> > Regards,
> > Tom Ogilvy
> >
> > "Alvin Hansen" <AlvinHansen@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> > news:F2892D45-71CA-4894-BA40-F795ED9A2D52@xxxxxxxxxxxxxxxx
> > > Thanks
> > > its working
> > > Maybe you can help more?
> > > If the file name is in a txt file
> > > how can i get this filename?
> > >
> > > Best ragards
> > > Alvin
> > >
> > >
> > > "Tom Ogilvy" wrote:
> > >
> > > > Sub ABC()
> > > > Shell "C:\Windows\Notepad.exe 'C:\Myfolder\Myfile.txt"
> > > > End Sub
> > > >
> > > > worked for me.
> > > >
> > > > --
> > > > Regards,
> > > > Tom Ogilvy
> > > >
> > > >
> > > >
> > > > "Alvin Hansen" <AlvinHansen@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in
message
> > > > news:077860F4-6A53-496D-AA2D-83DD16C92060@xxxxxxxxxxxxxxxx
> > > > > Hi jari
> > > > > its the same i want to
> > > > > I have try call shell but that only working with a exe fil
> > > > > if i have maby a mdb(access) file
> > > > > name c:\grub.mdb i want to open this file with access
> > > > >
> > > > > if i try that with call shell i get a error
> > > > >
> > > > > alvin
> > > > >
> > > > >
> > > > > "Jari Toukkari" wrote:
> > > > >
> > > > > > If someone knows how to open a file in another program, I would
be
> > > > grateful.
> > > > > > For example open a certain xxxx.txt file in the Notepad.
> > > > > > Regards, Jari
> > > > > >
> > > > > >
> > > > > > "Alvin Hansen" <AlvinHansen@xxxxxxxxxxxxxxxxxxxxxxxxx> kirjoitti
> > > > > > viestissä:4EFE5F3D-FF15-4141-AF4E-626B23CD2033@xxxxxxxxxxxxxxxx
> > > > > > > Hi
> > > > > > > How can i with a command buttom stating
> > > > > > > another program not excel.
> > > > > > >
> > > > > > > Hope someone can help
> > > > > > >
> > > > > > > alvin
> > > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > >
> > > >
> > > >
> >
> >
> >


.