Hi to everyone...

Just for clarification and added information...can someone please explain
deeper what are VB RUNTIME Files and its use or benefit if i dont have
VB software.

Your response would most likely help me before i start programming in VB,
thanks a lot.

Visual Basic runtime files are the files needed to run a Visual Basic application. When looking at Visual Basic it is merely a programming language used to write a program, where the runtime files are files needed by the application in order to work correctly.

These files are needed by all Visual Basic applications.


To put it bluntly no Visual Basic application would perform correctly, if at all, without the Visual Basic runtime files.

hey thanks a lot for that information. so it means if i developed a program under VB and want other machines to use my program then there's no need for me to install the whole vb application and IDE. all i do is install the runtime
files to other machines...right?

and one more thing, is there a way for me to load an Word document using VB by using the SHELL command? because im loading a Word document unfortunately its not loading but when i try to load a .pdf file its loading. I have already check for the file in the location it is there...what could be wrong?


thanks man...

Yes that is right, you would only need to install the runtime files.

For the question about the word document, I presume you are trying to either open microsoft word, or trying to open an existing microsoft word document. The best way here would be to use the shell function. I do know VB has support for it but I have not used vb's shell function, rather have a look at this alternative shell function, which is the one I am using. It is great and there is an explanation on how it works.

Hope you come right.

They are whole bunch ocx and dll files that VB uses behind the scenes in order to make the application work. A Few of things include some of the tools that you might use, (some control's) and so forth. Microsoft has or had an EXE that automatically installed the VB runtime files (a cute little setup program), and it was easily downloadable. You could distribute it with your application if you wanted to run a "setup" program, that you had built in VB.

Also, it's a lot easier to use VBS with word. If you know the path to word, you can use shell, but this is much easier:

Dim Word
Set Word = CreateObject("Word.Application")
Set doc = Word.Documents.Add("c:\path2worddoc\somedocument.doc")
Word.Visible = True

That will create a word object, it will add the document of your choice (Given by path in the add method), and then make the word window visible. However, before you make your project close, make certain that you set the references to word and to doc to nothing.... otherwise it will stay loaded, even after your close the document, word and your app. Bad Bad Code. So, in form unload:

set word = nothing
set doc = nothing

That should unload word's process when it's closed. If you really want to use shell, you can, but you have to know the path to word's EXE file, and then you have to pass it the path of the file you want to load. For example, on my system:

path2file = "c:\my documents\word\hello.doc"
retval = shell("C:\Program Files\Microsoft Office\Office10\winword.exe " & path2file, vbnormal)

Let me know which method you choose, and what works best for you.

thanks a lot comatose and auron...your replies are simply encouraging me to continue learning VB programming. Anyway, regarding the loading of word document well im using the "shell" command but its not loading my word document, maybe i will try to use this one:

Dim Word
Set Word = CreateObject("Word.Application")
Set doc = Word.Documents.Add("c:\path2worddoc\somedocument.doc")
Word.Visible = True

at last...im enlightened regarding the vb runtime files. thanks again folks.

by the way...i have here 4 versions of runtime files, do i have to install them all or the latest one only?

You should only need to install the most recent ones. Hang in there with programming in VB, and keep pushing yourself to learn more. Don't feel restricted to VB though... once you get a grip on it, and feel comfortable building apps, move on to something else, like C or Perl. Let me know if my method for loading the word doc works. :)

hey comatose your code for loading a word document works just perfectly fine...its great man! one more thing...how about loading an excel sheet? because i tried to change your code for loading an excel sheet but it gives me an error. thanks.

Set objExcel = CreateObject("Excel.Application")
Set objWorkbook = objExcel.Workbooks.Open("C:\PATH2XLS\whatever.xls")
objExcel.Visible = true

Now, you can change between those little tabs at the bottom (sheets) by using:

objExcel.ActiveWorkbook.Sheets(1).Select()

and whatever you do, DO NOT forget to:

set objExcel = nothing

thanks man...work perfectly. so see yah all tomorrow have to go. thanks a lot for all your help...take care.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.