Previous in Forum: XP compatible software to be installed on vista   Next in Forum: Another Waste Time?
Close
Close
Close
23 comments
Power-User

Join Date: May 2008
Location: Europe
Posts: 285
Good Answers: 9

Visual Basic 2008 Express Edition

10/29/2008 10:44 AM

Dear all,

I am looking for some assistance. This is not home work or anything to do with my job - I just want to do this for my own benefit. Ok here goes:-

I downloaded Visual Basic 2008 Express Edition (Microsoft Visual Studio 2008 Version 9.0.30729.1SP) - mainly because it was free !!!

I want to open two separate existing excel files. I want to check if the contents of say cell A1 (from first file) are in the second file. I have used VB6 in the past (when I say past I mean very past). Can someone point me in the right direction here i.e a good website etc. I have googled myself to death and have not found anything useful (or rather that I could properly understand ).

I am sure there must be a "VB 2008 for complete idiots" book out there so if anyone knows then please let me know.

I have used VB6 to interact with txt files in the past but I cannot recall interacting with excel files. I know that VB6 and VB 2008 are different beasts and I am trying (in vain) to apply my fading memories of VB6 to VB 2008 without much (any) success.

To be honest the files are not that big so it would not take that long to go through it manually. However my stubornness has gotten the better of me.

I am open to the fact that I may not have the necessary skills to carry this task out and that I will have to take a VB course - I will probably do this in any case.

Thanks in advance for any help that you give

Kind Regards

Mr. W.A Snow

Register to Reply
Interested in this topic? By joining CR4 you can "subscribe" to
this discussion and receive notification when new comments are added.

Comments rated to be Good Answers:

These comments received enough positive ratings to make them "good answers".

Comments rated to be "almost" Good Answers:

Check out these comments that don't yet have enough votes to be "official" good answers and, if you agree with them, rate them!
Participant

Join Date: Oct 2008
Location: united states
Posts: 4
#1

Re: Visual Basic 2008 Express Edition

10/29/2008 6:14 PM

hi there!

iam not quite sure whether i get it or not

but i believe that the version u have downloaded isn't that good enough or complete!

sometimes errors happen or specific benefits or "properties" get lost because of losing specific files through the downloading process,and these files are the key to use the missed benefits;

you may download it once again but from authorised source....and there are so many good sources for such program.

hope i have been helpful!

__________________
Genius is one per cent inspiration and ninety-nine per cent perspiration. Accordingly, a 'genius' is often merely a talented person who has done all of his or her homework.
Register to Reply Score 1 for Off Topic
Power-User

Join Date: May 2008
Location: Europe
Posts: 285
Good Answers: 9
#3
In reply to #1

Re: Visual Basic 2008 Express Edition

10/30/2008 3:21 AM

niveen, I downloaded it from the Microsoft site so I don't think there is a problem with the downloaded version - the "problem" is that I am trying to apply my fading knowledge of VB 6 to VB 2008 and it is proving difficult. I was hoping that someone could point me to a good website that might assist.

Of course I could get some else to do this for me and it would probably take all of 5 mins but if I do that that then I will not have learned anything.

Thanks for taking the time to respond.

Kind Regards

Mr. W.A Snow

Register to Reply
Power-User

Join Date: Nov 2007
Location: South Florida
Posts: 394
Good Answers: 8
#2

Re: Visual Basic 2008 Express Edition

10/30/2008 2:51 AM

Dear HoleInTheSnow,

Here is a good place to start:

http://en.wikipedia.org/wiki/Visual_Basic

As for the Dummies series, it's called "Beginning Programming for Dummies, 4th Edition. Provides a basic refresher and gives you Liberty Basic compiler, REALbasic, Revolution and C++. Thatis by Wallace Wang.

/Ari (Orpheuse)

__________________
Orpheuse
Register to Reply
Power-User

Join Date: May 2008
Location: Europe
Posts: 285
Good Answers: 9
#4
In reply to #2

Re: Visual Basic 2008 Express Edition

10/30/2008 3:27 AM

Orpheuse, thanks, I will check this out and look at getting myself a good book. I will let you know either way how I get on (it might take time before I have managed to complete simple task this so don't expect a response today or tomorrow)

Kindest of regards

Mr. W.A Snow

Register to Reply
Power-User

Join Date: Nov 2007
Location: South Florida
Posts: 394
Good Answers: 8
#9
In reply to #4

Re: Visual Basic 2008 Express Edition

10/30/2008 10:08 AM

Whenever you are ready, Buddy. I look forward to it. One word of caution, things have changed a great deal since you and I were programming IBM 360 mainframes. As obvious as it is, the structure and language of BASIC has changed into something that looks like a mash up between IBM BASIC and Pascal, FORTRAN, and C.

I recommend doing the silly exercises in the book, and read the inane wording for that one gem that gives you the 'Aha' moment. As frustrating as that is, it is the only way to get up to speed. If I may suggest an approach, learn the new BASIC via functions rather than commands.

Good luck and be sure to drop me line when you're ready.

/Ari (Orpheuse)

__________________
Orpheuse
Register to Reply
3
Commentator

Join Date: May 2008
Location: St. Paul , MN
Posts: 79
Good Answers: 6
#5

Re: Visual Basic 2008 Express Edition

10/30/2008 7:27 AM

A good start would be the following webpage which covers some basic excel operation in vb.net

http://www.vbdotnetheaven.com/UploadFile/ggaganesh/ExcelSpreadsheet04182005093012AM/ExcelSpreadsheet.aspx - sorry, link no longer available

Register to Reply Good Answer (Score 3)
Anonymous Poster
#6
In reply to #5

Re: Visual Basic 2008 Express Edition

10/30/2008 8:33 AM

Good answer! you actually answered the question asked instead of trying to steer the asker to another operating system or programming environment. The free VB.net is a very complete development environment and is actually easy to use. The other free .net including C++ and C# are equally good. By the way MS has good tutorial pages for these environments too. I actually worked through a couple and learned a few tricks, and I have been programming in Visual C++ for several years. Live and Learn.

Register to Reply
Power-User

Join Date: May 2008
Location: Europe
Posts: 285
Good Answers: 9
#18
In reply to #5

Re: Visual Basic 2008 Express Edition

10/30/2008 6:03 PM

Daddio926, thanks for the link. I will certainly check it out. I actually downloaded some examples where excel is being used in VB 2008 so I will try to understand what is happenning there and then apply it to my application.

I am going to have a beer now so perhaps I will get an "Aha" moment after a few.

Regards

Mr. W.A Snow

Register to Reply
Guru
United Kingdom - Member - Not a new member!

Join Date: Jun 2008
Location: USA/Europe
Posts: 4547
Good Answers: 68
#7

Re: Visual Basic 2008 Express Edition

10/30/2008 8:39 AM

Hello HoleInTheSnow:

I Googled 'VB 2008 to use with excel files' and got the sites below. They seem to be aimed at people who have not used VB 2008 before. The top link is the site with lots of other sites. The one below is a site which you can join and seems it will answer any question you may need, that is to do with VB 2008 with Excel.

Can you let me know how you get on please, because I am thinking along similar lines.

http://www.google.co.uk/search?sourceid=navclient&ie=UTF-8&rlz=1T4GGLJ_enGB294GB294&q=VB+2008+to+use+with+excel+files

http://visualbasic.ittoolbox.com/groups/technical-functional/visualbasic-l/how-to-open-an-excel-file-in-vb-1972875

__________________
Take it easy, bb. >"HEAR & you FORGET<>SEE & you REMEMBER<>DO & you UNDERSTAND"<=$=|O|=$=>"Common Sense is Genius dressed in its Working Clothes"<>[Ralph Waldo Emerson]
Register to Reply Score 1 for Good Answer
Power-User

Join Date: May 2008
Location: Europe
Posts: 285
Good Answers: 9
#10
In reply to #7

Re: Visual Basic 2008 Express Edition

10/30/2008 11:14 AM

babybear, thanks for the links. I will certainly let you know how I get on.

To be honest alot of the sites that I visited were probably very good and probably explained everything correctly but for some reason or other it did not sink in (maybe its because I'm thick or something - I though I would say it before someone else did ).

I have alsmost completed the task at hand in VBA but that is not what I am after. I am hoping that I will be able to apply some of the VBA ideas when I eventually find out how to open a god damn excel spreadsheet using VB 2008.

To be honest if a "real" programmer saw what I had written they would probably fall off their chair - but I am only an engineer trying to learn a bit about high level programming.

Again thanks for the assistance and I will certainly let you know how I am getting on - I hope to have it completed before Christmas (not mentioning which year !!!).

Kind Regards

Mr. W.A Snow

Register to Reply
2
Guru
Engineering Fields - Electromechanical Engineering - Technical Services Manager Canada - Member - Army brat Popular Science - Cosmology - What is Time and what is Energy? Technical Fields - Architecture - Draftsperson Hobbies - RC Aircraft - New Member

Join Date: Sep 2006
Location: Clive, Alberta, Canada
Posts: 5906
Good Answers: 204
#12
In reply to #10

Re: Visual Basic 2008 Express Edition

10/30/2008 12:57 PM

First off.. if all you want to do is manipulate excel, you don't need VBxx.. you can do it all with VBA which comes with Excel. This is especially useful to know, because it gives you direct acces to the excel objects, which are exposed to the vba environment within excel. the following is some how-to within a vba module. (or userform if you wish.) you can then link a button on a given sheet to the macro(whatever you name it)

you can open sheets using:

Sub OPEN_SEL_QUOTE()
Dim myQuote As String

dim a
myDir = "K:\CTE Quote Log\"
myQuote = myDir + "QUOTES\" + "CTE QUOTE - " + Cells(Selection.Row, 2) + ".xls"
a = Dir(myQuote)
If a <> "" Then Workbooks.Open myQuote

End Sub

You can switch between workbooks you have open using:

Windows("BOM TEMPLATE.xls").Activate

You can then select sheets within that workbook using

Sheets("INVENTORY").Select

you can count rows or columns in a sheet or range if they contain data

'count rows in template
subRowCtr = 4 'start row
Do While Cells(subRowCtr, 1) <> ""
subRowCtr = subRowCtr + 1
Loop

you can save a copy of a compiled sheet... and even preview it before printing.

Activesheet.PrintPreview

'SAVE SHEET OUT
myBomOut = myDir + "BOMS\" + "CTE BOM - " + quoteTitle + ".xls"
ActiveSheet.Copy
ActiveSheet.SaveAs myBomOut

you can close the selected sheet using:

Activesheet.Close or
Windows(myBOM + ".xls").Close

lastly, if you wish to compare the contents of cells.. repetitiously, then make a variable to contain the data from sheet 1, switch to sheet to, and then:

Dim myRow As Integer
Dim myCol As Integer
myRow = 12
myCol = 3
If cells(myrow,mycol)=myVariable, then
do something
Else
do something else
End If

you can also turn off the screen flickering with screenupdating function, and prevent having to deal with dialogs popping up (ie, file overwrite on save)

Application.ScreenUpdating = False (or true)
Application.DisplayAlerts = False (or true)

this should get you most of what you want.

yell if you need help.. chrisg288@hotmail.com

I have made a quotation system in excel.. allows part and subassembly selection to create quote files.. updates pricing from other sheets.. all written in vba.. it is a bit slow at times.. but there are a lot of benefits.. the data is readily accessible to all users, and when the time comes to migrate to an MRP system the data will be easy to migrate.. secondly, sharing the software is automatic - no install required, training is straightforward - diy... and the code is available to other users if they wish to expand on it.

Register to Reply Good Answer (Score 2)
Power-User

Join Date: May 2008
Location: Europe
Posts: 285
Good Answers: 9
#15
In reply to #12

Re: Visual Basic 2008 Express Edition

10/30/2008 3:04 PM

chrisg288,thanks for the info. I know I do not need to use VB 2008 or VB6 etc and that I could do this using VBA (currently I have almost completed what I want to do using VBA).

To be honest I just want to learn to use VB2008 properly/ somewhat - don't really have a master plan for becoming a VB expert. I could have easily picked some other language but since so much is written about VB I thought I would give it a bash and I have used VB 6 in the past.

Again thanks for taking the time to respond and if I get stuck with VBA then I may take you up on your offer to help.

Kind Regards

Mr. WA Snow

Register to Reply
Associate

Join Date: Oct 2008
Location: Alabama, USA
Posts: 38
#13
In reply to #10

Re: Visual Basic 2008 Express Edition

10/30/2008 1:00 PM

Visual Basic works as Object Linking and Embedding (OLE) function for using other programs, in such you may need have installed Microsoft Excel in order to link to it to use its features, this is similar to making Visual Basic a Visual Basic OLE server which supports visual editing of a database in a controlling application. OLE is implemented by Visual Basic so VB can be a client or a server. As client VB is a OLE Container , as such it can control to display linked or embedded objects belonging to server applications. The type of object depends on the server. A spreadsheet program typically provides worksheet objects and graph objects. A word processing program provides document objects. A graphics program provides picture objects. The other element implemented by Visual Basic is OLE Automation. In OLE Automation, the server application (the OLE Automation server) "exposes" its objects. Any OLE client application (OLE Automation Controller) then has access to the public methods and properties of these exposed objects. The OLE Automation Controller can control the operation of the OLE Automation Server application by manupulating the server's objects. You can use the OLE Object field type in a Microsoft Access database file to store linked or embedded OLE objects, then display those objects on a Visual Basic form, in using OLE Container control linked to a Data Control.

__________________
Serving The Public Better The Electric Vehicle Free Conversion Foundation (EVFCF)
Register to Reply
Anonymous Poster
#8

Re: Visual Basic 2008 Express Edition

10/30/2008 8:41 AM

the example app on the MS site seems a bit complex but you may want to give it a peek. http://support.microsoft.com/kb/316126/en-us

Register to Reply
Power-User

Join Date: May 2008
Location: Europe
Posts: 285
Good Answers: 9
#11
In reply to #8

Re: Visual Basic 2008 Express Edition

10/30/2008 11:16 AM

Guest, thanks for the link. I am going to have a good look at this over the weekend (I may have a few beers aswell - but then I will probably forget what I have learned).

Regards

Mr. W.A Snow

Register to Reply
2
Anonymous Poster
#14
In reply to #11

Re: Visual Basic 2008 Express Edition

10/30/2008 1:45 PM

The version you have is fine, but you should also download the MSDN Express as well. This is where you will find a mountain of examples, additional help files, etc.

As far as what you are trying to do, vb.net is still OOP (Object Oriented Programming). I haven't updated to 2008 yet out of laziness, but this should be close...

1)From the project pulldown menu, click "AddReference", when the dialogue pops up, click the COM (Component Object Model) tab.

2)Then select the appropraite microsoft excel library. Mine is Microsoft Excel 9.0 object library, you may have older versions from previous installatons as well.

3)Now declare your objects in your code such as :

Dim ExlApp as Excel.Application

4) Then you have to use "Set" to assign your variable:

Set ExclApp = YattaYattaYatta

5) You now have direct access to everything in Excel VBA version 6 including the open and close methods.

6) THIS IS IMPORTANT - Don't forget to release the excel app when finished by using:

Set ExclApp = Nothing

You to have do this even with error handlers.... hope this helps, msdn will have more in depth sample code of how to set and release objects.

Register to Reply Good Answer (Score 2)
Power-User

Join Date: May 2008
Location: Europe
Posts: 285
Good Answers: 9
#16
In reply to #14

Re: Visual Basic 2008 Express Edition

10/30/2008 3:17 PM

Guest, Thanks. It kind of makes sense to me now (eventually) what I need to do. I will try out your suggestion and see what happens.

Thanks

Mr. W.A Snow

Register to Reply
Power-User

Join Date: Nov 2007
Location: South Florida
Posts: 394
Good Answers: 8
#17
In reply to #16

Re: Visual Basic 2008 Express Edition

10/30/2008 3:56 PM

Dear Mr. Snow,

In my meandering travels I have discovered that programing today involves snippets of code strung together like beads on a chain. This encompasses things like templates as well.

Try doing a search on VBasic code examples, or VBasic tutorials, VBasic Templates, etc ...

I downloaded the example suggested by DADDIO926 IN POST #5. I gotta tell you, Bro, it looks interesting. Unfortunately it doesn't look like any version of BASIC that I've seen before. Looks more like Pascal or OS/JCL (Operating System/Job Control Language)

Look like I need to go back to spot #1 and reteach myself BASIC and specifically VBasic.

Good luck, buddy. Let me know the outcome. Especially any problems you run into.

/Ari (Orpheuse)

__________________
Orpheuse
Register to Reply
Power-User

Join Date: May 2008
Location: Europe
Posts: 285
Good Answers: 9
#19
In reply to #17

Re: Visual Basic 2008 Express Edition

10/30/2008 6:10 PM

Orpheuse, To me VB 2008 does not look that different to VB 6 (Ok the IDE is a bit different) but it certainly does not operate the same way (as far as I recall). I though of reverting back to VB 6 but I have decided against that (for the moment).

I am still trying to get this to operate but since I have no real deadline I have decided to take my time and understand what I am doing.

I will be back with an update and no doubt further requests for help.

Kind Regards

Mr W.A Snow

Register to Reply
Power-User

Join Date: Nov 2007
Location: South Florida
Posts: 394
Good Answers: 8
#20
In reply to #19

Re: Visual Basic 2008 Express Edition

10/30/2008 8:03 PM

My dear Mr. Snow,

You are asking questions that more than one of us want the answers to. A word to the wise: where you found information useful, give the poster a point. It only takes a second and we live for them.

Your good friend,

/Ari (Orpheuse

__________________
Orpheuse
Register to Reply
Power-User

Join Date: May 2008
Location: Europe
Posts: 285
Good Answers: 9
#21

Re: Visual Basic 2008 Express Edition

11/04/2008 2:23 PM

Dear All,just a quick update on my progress (or lack of - actually I have made progress, I know more now than I did when I started). I have ordered a VB for Dummies book as I want to get the basics right. As I am in no real rush to get this "project" completed I decided it prudent to get the basics right from the start.

When I have completed my "project" I can post the details on what I had to do if that woud be of interest to anyone. Perhaps I may be able to assist someone in the future.

I just think it important to provide some feedback as alot of people took time out to assist me and I am grateful for that.

Kindest of regards to all

Mr W.A Snow

Register to Reply
Guru
United Kingdom - Member - Not a new member!

Join Date: Jun 2008
Location: USA/Europe
Posts: 4547
Good Answers: 68
#22
In reply to #21

Re: Visual Basic 2008 Express Edition

11/04/2008 6:03 PM

Hello HoleInTheSnow:

I think you could get help on the site to say how to do a particular task.

But, to learn from scratch, then some kind of book or other learning tool it best. At least until you become proficient and get used to the structure of the Language?

Good luck and, yes, I think there will be others who would find your experience helpful.

__________________
Take it easy, bb. >"HEAR & you FORGET<>SEE & you REMEMBER<>DO & you UNDERSTAND"<=$=|O|=$=>"Common Sense is Genius dressed in its Working Clothes"<>[Ralph Waldo Emerson]
Register to Reply
Member

Join Date: Mar 2009
Location: Bullcreek Western Australia
Posts: 5
Good Answers: 1
#23

Re: Visual Basic 2008 Express Edition

03/08/2009 11:49 AM

Dear Mr. Snow,

I'm in the same 'boat' as you are, I think. I found the Teach Yourself Visual Basic 2008 in 24 hours by Sams Teach Yourself/James Foxall a good book. You work your way through it and you get the idea as to how to go about things quite well again.

Regards and good luck,

John.

Register to Reply
Register to Reply 23 comments
Interested in this topic? By joining CR4 you can "subscribe" to
this discussion and receive notification when new comments are added.

Comments rated to be Good Answers:

These comments received enough positive ratings to make them "good answers".

Comments rated to be "almost" Good Answers:

Check out these comments that don't yet have enough votes to be "official" good answers and, if you agree with them, rate them!
Copy to Clipboard

Users who posted comments:

Anonymous Poster (3); babybear (2); CharlesJones (1); chrisg288 (1); Daddio926 (1); HoleInTheSnow (9); niveen (1); Orpheuse (4); SafOcean (1)

Previous in Forum: XP compatible software to be installed on vista   Next in Forum: Another Waste Time?

Advertisement