Open .xls with viewer

I have a program that will open .xls files with the full version of excel. How can i get it to open the fiels with excel viewer. This is with Visual Basic 6
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

if you goto Project > Components you can add the Microsoft Internet Controls which will give you the Webbrowser control. If you add that control you can view excel files using something like this:

Private Sub Command1_Click()
WebBrowser1.Navigate2 "C:\Test.xls"
End Sub
KiriusAuthor Commented:
Well what I have is a program where you can choose what .xls you want to view. Each .xls has about 10-50 sheets in it. I can open it fine on workstations with full versions of office. But some workstations, I don't want to use Internet Explorer or Full version excel because they don't have it on those. But to open it with Excel Viewer.
if you are using shellexecute api it will launch xls files with the default app which would be the full version of excel if it exists. To launch the viewer you will need to have it's location:

Private Sub Command1_Click()
Dim ExcelFile as String
ExcelFile =  Chr(34) & "C:\Test.xls" & Chr(34)

Shell Chr(34) & "C:\Program Files\Microsoft Office\OFFICE11\XLVIEW.EXE" & Chr(34) & " " & ExcelFile, vbNormalFocus

End Sub

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" ( _
     ByVal hwnd As Long, _
     ByVal lpOperation As String, _
     ByVal lpFile As String, _
     ByVal lpParameters As String, _
     ByVal lpDirectory As String, _
     ByVal nShowCmd As Long) As Long

Private Sub Command1_Click()
Dim xlsPath, xlsVwr As String
Dim retVal As Long

'Path of excelviewer can be extracted out of the registry.

'Path of the XLS File
xlsPath = App.Path & "\map1.xls"

'Run the Viewer
retVal = ShellExecute(Me.hwnd, "Open", xlsVwr, xlsPath, "", 1)

End Sub
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.