[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 208
  • Last Modified:

selecting excel sheet to display

I want to have an empty OLE window on my form, and then, once the prog runs, i want to select the excel sheet to display from a normal directory list box. is this possible? Sample code will be appreciated.
0
psimation
Asked:
psimation
  • 3
  • 2
1 Solution
 
adityauCommented:
Use the following code

Option Explicit

Private Sub Command1_Click()
    OLE1.SourceDoc ='File to be displayed
    OLE1.Action = 0
End Sub
0
 
psimationAuthor Commented:
This is how I tried it from the start, but vb tells me expected line number or statement or label or end of statement.
( that is when I simply say ole1.sourcedoc = C:\WINDOWS\Desktop\xxx.xls)
If I try
ole1.sourcedoc = 'c:\windows....
it says expected expression
Can you help me?
PS, VB6.0
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
psimationAuthor Commented:
Hey, I got it right, the problem was in the name of the xl file, it had a space in the name, I renamed it and now it works. I will however allocate you the points, just re-answer.
0
 
adityauCommented:
Here I am re-answering the question.
0
 
psimationAuthor Commented:
Hey, I got it right, the problem was in the name of the xl file, it had a space in the name, I renamed it and now it works. I will however allocate you the points, just re-answer.
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now