Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / July 2006

Tip: Looking for answers? Try searching our database.

Open Excel workbook. VB and VC

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
k-w - 24 Jul 2006 15:27 GMT
Hi all

In vb  I do:

Dim Ex As New Excel.Application
Ex.Workbooks.Open "c:\tmp\Book1.xls"

Similar code in VC doesn't work:

#pragma comment(lib, "ole32.lib")
#import "c:\program files\Microsoft Office\OFFICE11\XL5EN32.OLB"
rename("DialogBox","__AA__")

/* ... */

Excel::ApplicationPtr app(L"Excel.Application");
((Excel::WorkbooksPtr)app->Workbooks())->Open(_variant_t("c:\\tmp\\Book1.xl­s"));

Index is wrong - yes because we didn't open Workbook yet

How to eliminate/fix/bypass this error

Or may be it should be different way to open Excel workbook in VC?

Best regards,
Vasiliy
www.fruitfruit.com - 25 Jul 2006 09:11 GMT
There is a little difference between VC and VC. Refer to some code
snippets here
http://www.fruitfruit.com/vc/activex/excelauto.cpp

> Hi all
>
[quoted text clipped - 22 lines]
> Best regards,
> Vasiliy
k-w - 26 Jul 2006 14:31 GMT
thank you very much - very helpful

Best regards,
vasiliy

> There is a little difference between VC and VC. Refer to some code
> snippets here
[quoted text clipped - 26 lines]
> > Best regards,
> > Vasiliy

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
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.