Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Programming VBA / June 2005

Tip: Looking for answers? Try searching our database.

Openning an excel file

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Frederico Ottoni - 28 Jun 2005 21:55 GMT
Hello there,

I work with outlook VBA and I have to open an excel file throught code,
but the Excel is not openned. How can I do to open this file?

Thanks,
Ottoni.
Michael Bauer - 29 Jun 2005 07:06 GMT
Hi,

I´d add a reference to Excel via Tools/References, that makes
IntelliSense available and allows you to explore Excel´s methods etc. in
the Object Browser (F2).

For opening a Workbook please use Workbooks.Open. A sample is availabe
in Excel´s VBA help.

Signature

Viele Gruesse / Best regards
Michael Bauer - MVP Outlook

> Hello there,
>
[quoted text clipped - 5 lines]
>
> *** Sent via Developersdex http://www.developersdex.com ***
Frederico Ottoni - 30 Jun 2005 14:12 GMT
Thanks for the response.
But I am already using that and it only works if, before running the
macro, I open the excel. Doing that it works perfectly, open the file I
want, edit every thing I need, close the file... But I do not want the
user have to open the excel before run the system. So, thats my problem.
I am using
 
 Set appExcel = GetObject(, "Excel.Application")
 appExcel.Workbooks.Open (strSheet)

Any idea?

Thanks,
Ottoni.
Michael Bauer - 30 Jun 2005 20:29 GMT
Frederico, you can use your first statement. If it raises an error, i.e.
appExcel is nothing, then you know that Excel isn´t running already. In
that case call CreateObject("Excel.Application") instead of GetObject.

Signature

Viele Gruesse / Best regards
Michael Bauer - MVP Outlook

> Thanks for the response.
> But I am already using that and it only works if, before running the
[quoted text clipped - 12 lines]
>
> *** Sent via Developersdex http://www.developersdex.com ***
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.