-
Feb 4th, 2012, 03:11 PM
#1
Thread Starter
New Member
Simply open excel
I just installed Visual Studio 2010
I want ONLY write code in order to use data stored in a excel file.
I just want to create a Form , open an excel file and browse it.
Should I create a pecial project ? Should In install something more than just Visual studio ? Should I declare or add any library ? what are the code instructions to be used ?
-
Feb 4th, 2012, 11:09 PM
#2
Re: Simply open excel
see the tutorial in the faq thread at the top of this forum
yes you should start a new project, you would need a reference to excel, unless you use late binding
as long as excel is already installed you should not need to install any additionals
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
-
Feb 5th, 2012, 05:07 AM
#3
Thread Starter
New Member
Re: Simply open excel
sorry, i didn't understand ... I started a new project, put a button in Form1 ans wrote some code on clicking the buutton
i used the code Workbooks.open("myexcelfile.xls") and i get error od workbooks. the system asks me to create the Workbooks class .....
-
Feb 5th, 2012, 05:37 AM
#4
Re: Simply open excel
yes, you have to create an object of excel first, then the workbooks collection is a property of that object, on which you can use the open or add methods
did you look at the tutorial?
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
-
Feb 5th, 2012, 09:36 AM
#5
Thread Starter
New Member
Re: Simply open excel
I didn't look at the tutorial, because I don't know which tutorial ...... You're so kind and I'm grateful, would you like to lead me with details ?
-
Feb 5th, 2012, 02:45 PM
#6
Re: Simply open excel
i only use vb6 so i can not help with visual studio 2010, apart from basics, you need to research more, or wait till someone familiar with .net syntax reads the post
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|