Link to home
Start Free TrialLog in
Avatar of mmahdi
mmahdi

asked on

VB & Excel

I am trying to do the following using excel OLE objects in VB:

* Open  a specific filename in excel from VB
* Open the file in readonly mode
* make excel with the workbook the active window
* make excel open maximised

I am sure there is an easy answer, but could not find the correct syntax do it

I would appreciate some help

Regards
Baltaz13
Avatar of qizhizhu
qizhizhu

Try "Shell" command. you need to activate ".exe" file first, then open your excel file from VB. The syntax should look like "Shell("c:\excel.exe","c:\excle.xls").
Also you can try "GetObject" or try to use active X control.

Avatar of mmahdi

ASKER

qizhizhu,

It is not the answer I had in mind. I am looking for the syntax for OLE automation with Excel such as:

Set obj= CreateObject("excel.APPLICATION.8")
obj.Workbooks.Open (excelfile)
.
.

Regards
Baltaz13
ASKER CERTIFIED SOLUTION
Avatar of yronnen
yronnen

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mmahdi

ASKER

Yronnen,

It worked fine,
Thanks for your help!


Baltaz13