Open and move around an excel from VB 2008
Open and move around an excel from VB 2008
Open and move around an excel from VB 2008
Open and move around an excel from VB 2008
Open and move around an excel from VB 2008
Open and move around an excel from VB 2008 Open and move around an excel from VB 2008 Open and move around an excel from VB 2008 Open and move around an excel from VB 2008 Open and move around an excel from VB 2008 Open and move around an excel from VB 2008 Open and move around an excel from VB 2008 Open and move around an excel from VB 2008
Open and move around an excel from VB 2008 Open and move around an excel from VB 2008
Open and move around an excel from VB 2008
Go Back  Xtreme Visual Basic Talk > > > Open and move around an excel from VB 2008


Reply
 
Thread Tools Display Modes
  #1  
Old 04-20-2010, 10:38 AM
samuvk samuvk is offline
Newcomer
 
Join Date: Apr 2010
Posts: 4
Default Open and move around an excel from VB 2008


I'm trying to open an excel file and then move around a little bit in the excel from VB 2008 and I having some problems.
I'm trying next:

dim objExcel as excel.application

objExce = new excel.application

objExcel.visible=true

'I get a error while trying next

objExcel.sheetsInNewBook = 1 'To indicate how many sheets in the book

'I get a error while trying next

objExcel.Workbooks.add()

I would like how can I move from a book to other and from a Sheet to other. I tried next and it didn't work:

windows("Book.xls").activate()

sheets("Sheet1").select()

My last question is: How can I open directly a templete book that already exist to work with it?

Thank you very much for all your help
Reply With Quote
  #2  
Old 04-20-2010, 04:28 PM
Mike Rosenblum's Avatar
Mike Rosenblum Mike Rosenblum is offline
Microsoft Excel MVP

Forum Leader
* Guru *
 
Join Date: Jul 2003
Location: New York, NY, USA
Posts: 7,848
Default

Hi Hi Samuvk,

I'm not sure why you are having trouble with some of these commands...

You might want to have a look at the Automating Office Programs with VB.NET tutorial. Try duplicating the code used there so that we can confirm that your Excel and Visual Studio setup is operating correctly.

Once you have that going, if you still have trouble with your code then post it again, but I think that reading the tutorial should help a lot.

-- Mike
__________________
My Articles:
| Excel from .NET | Excel RibbonX using VBA | Excel from VB6 | CVErr in .NET | MVP |
Avatar by Lebb
Reply With Quote
  #3  
Old 04-28-2010, 04:37 AM
JustinCase2 JustinCase2 is offline
Junior Contributor
 
Join Date: Apr 2006
Posts: 324
Default If I am not mistaken

you can open a workbook based on a template by simply specifying the template path in the .add function:

Code:
objExcel.Workbooks.add("PathToTemplate")
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Open and move around an excel from VB 2008
Open and move around an excel from VB 2008
Open and move around an excel from VB 2008 Open and move around an excel from VB 2008
Open and move around an excel from VB 2008
Open and move around an excel from VB 2008
Open and move around an excel from VB 2008 Open and move around an excel from VB 2008 Open and move around an excel from VB 2008 Open and move around an excel from VB 2008 Open and move around an excel from VB 2008 Open and move around an excel from VB 2008 Open and move around an excel from VB 2008
Open and move around an excel from VB 2008
Open and move around an excel from VB 2008
 
Open and move around an excel from VB 2008
Open and move around an excel from VB 2008
 
-->