visual basic

M

mike allen

is there a way to write stand alone programs (without excel) using the same
code as is used w/in excel vba?
the only "programming" i have done is w/in excel in the visual basic editor.
i have come a long way in my abilities to create almost anything i need w/in
the framework of excel (sometimes w/ help from this group). but all of my
"programs" are really .xls files, even though the spreadsheets themselves
contain no formulas (all formulas are in code). the spreadsheets are only
used for inputs, buttons to call the code, and output.
i am familiar w/ the term "compiler" that a friend had for his C++ code and
from another friend who has visual fox pro, which he showed me how he writes
his code, sends that stand alone program to his customers along w/ a dll
(library of functions?) and his customers can run it w/out actually having
fox pro, excel, etc.
i kind of think microsoft has a product called visual basic that may be a
compiler, much like the above examples, but am totally unsure. bottom line:
is there a way i can use the code and knowledge i have w/ excel's vba in a
stand alone program? (note, i rely on many built-in functions--vlookup,
match, left, isnumeric, etc.-- and would not want to have to re-create them
myself). thanks, mike allen
 
J

Jill E

Mike,

Yes, Microsoft does have a program called Visual Basic which allows you to
create standalone programs. It will support most of your VBA code, with some
differences. Most VB manuals will give you some info on how to convert
between the two. You will probably have to identify Excel as an object and
then use this prefix on the lines of code which are Excel-specific.

Hope that helps,

Jill E
 
A

Auric__

is there a way to write stand alone programs (without excel) using the same
code as is used w/in excel vba?

Exactly as is, without changes? No.

But if you go to, say, eBay, or any other auction site (or one of the
"older software for sale" sites) and get a copy of Visual Basic 6,
it's pretty darn close. (It's actually almost identical except for
Excel-specific functions, and those *can* be accessed from VB, but the
"wording" is a wee bit different.)

Alternately, you could buy a copy of PowerBasic, which is IMHO a
superior product (although a bit harder to develop in):
http://www.powerbasic.com/
the only "programming" i have done is w/in excel in the visual basic editor.
i have come a long way in my abilities to create almost anything i need w/in
the framework of excel (sometimes w/ help from this group). but all of my
"programs" are really .xls files, even though the spreadsheets themselves
contain no formulas (all formulas are in code). the spreadsheets are only
used for inputs, buttons to call the code, and output.

I do that myself - I use Excel for a great many things - programming
is one of them but the list also includes finances, gaming (RPG
character sheets & such), simple sorting, etc.
i am familiar w/ the term "compiler" that a friend had for his C++ code and
from another friend who has visual fox pro, which he showed me how he writes
his code, sends that stand alone program to his customers along w/ a dll
(library of functions?) and his customers can run it w/out actually having
fox pro, excel, etc.

A compiler is just a program that turns text files into object code;
you also need a linker, which combines objects together and makes them
into a the final program.

(FoxPro (one word) is a database-slash-programming language.)
i kind of think microsoft has a product called visual basic that may be a
compiler, much like the above examples, but am totally unsure.

See above.
bottom line:
is there a way i can use the code and knowledge i have w/ excel's vba in a
stand alone program? (note, i rely on many built-in functions--vlookup,
match, left, isnumeric, etc.-- and would not want to have to re-create them
myself). thanks, mike allen

VLookup is Excel-specific. Match is too, I believe (don't have VB
installed right now so I can't check it). Left is built into VB, and I
*think* IsNumeric is, too.

If you buy VB, you should also get the MSDN disk (which is the help
system), and it includes "getting started" and similar stuff.
 
B

Bob Phillips

You will also have to buy Visual Basic, it is not a cheap product.

You might try getting a pre-used copy of VIBE on eBay.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
M

mike allen

what is "visual basic.net 2003 standard edition?" i see it on microsoft
website, but is only $100, so that must not be what i am looking for.
thanks, mike allen
 
A

Auric__

what is "visual basic.net 2003 standard edition?" i see it on microsoft
website, but is only $100, so that must not be what i am looking for.
thanks, mike allen

It's not the same as what you see in Excel/VBA. VB.Net is a completely
different language than what you're used to.
 
M

mike allen

this is my interpretation so far:
a full (not an upgrade), used version of Microsoft Visual Basic 6.0 from
ebay for $150-200 will allow me to essentially use the same code i am used
to using in excel/vba, but i will be able to create stand-alone programs
that others can use w/out excel. it will have matix's/spreadsheets for
input and output, i assume.
you mentioned "Excel-specific functions." what are those? vlookup, match,
isnumeric, len, trim, count, counta are some of the functions i use often
in code. are these "Excel-specific functions?" thanks, mike allen
 
P

Pyball

Mike,

You can use Visual Basic .Net 2003 or Visual Basic 6. There ar
differences between the two, but both will work. Moving to Visual Basi
from Visual Basic for Applications is not as difficult as some migh
think.

If you are serious about creating a stand alone program that automate
Excel my suggestion would be to buy a full version of Visual Basic
which ever you version you preferre. Also buy a book to get familai
with the launguage differences, and use the IDE.

Once you have gotten that far you will find out that you have to add
referrence to the Excel Object library. Then in your code you will hav
to istantiate an instance of Excel to access the object model.

And, yes, vlookup, match, counta are Excel specific functions.

Hope this helps
 
T

Tom Ogilvy

but i will be able to create stand-alone programs
that others can use w/out excel.

No, you can not create stand-alone programs that others can use w/out excel.

Not sure why others are implying that you can. If you want worksheets, the
user will either need to own a copy of Excel or you will have to buy a third
party control that provides functionality similar to excel.
 
P

Pyball

Mike,

Tom, is correct.

I'm sorry, I forget to write in my earlier post. You will need to hav
Excel loaded on the computer you are developing on in order to add th
referrence. Also, the end user will need to have Excel loaded on thei
computer to run your program
 
M

mike allen

if the developer and the user both have to have excel, then why use Visual
Basic 6.0, etc., vs. just excel and vba?
i am just seeing if there is a way to present something more "professional"
by creating a stand alone program. most of my
applications/programs/customized spreadsheets (whatever they are properly
called) are very complicated w/ involved math, have no spreadsheet formulas
(only code), very protected from tampering, etc. and deserve more credit
than to be called "a spreadsheet" or "an excel file", which is what one of
my users calls it. in a way, he is right, but if it were stand-alone, it
would be the real thing: a bona fide program. how would you defend a very
involved set of macros, functions, etc. that happens to be contained in
excel, and what do you call this? a program, an excel application, an excel
file, a customized spreadsheet...? thanks, mike allen
 
P

Pyball

Mike,

I fully understand what you are saying. I have created a couple of ver
extensive programs in Excel with no way of converting them to stan
alone programs. I constantly deal with user calling them macros
spreedsheets, Excel files, etc. For myself I just let it go and go
over it, and let them call them what ever they want. That's my take o
it anyway.

Good luck
 
B

Bob Phillips

$100 is not

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
B

Bob Phillips

$100 is less than I expected (presumably driven down by .Net), but is still
not cheap in my book<vbg>

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
M

Mark

Hi,

I have used VB6. You can view some of my handiwork at
http://au.geocities.com/windsofmark

You can probably get a VB6 program from a university
bookshop.

VB6 and vb.net are slightly different. You probably would
be better of with the latter. VB.net requires all
variables are set to their types eg: text as string,
nmuber as integer or single or long. You cannot set
everything to a variant, only variant types that are
unknown types.

You also have to use the property extension for all
objects. eg: Label.caption, textbox.text, etc..

Even Excel 2003 prefers the extensions. You should also
use structured code for excel 2003 and vb.net and vb6
eg:
instead of
If xxx=sss then exit sub

use
If xxx=sss then
exit sub
End If

regards
Mark

Visit my sites:
http:/www.gewocities.com/excelmarksway
http://au.geocities.com/windsofmark
 
K

Keith Willshaw

mike allen said:
what is "visual basic.net 2003 standard edition?" i see it on microsoft
website, but is only $100, so that must not be what i am looking for.
thanks, mike allen

You need VB6 Professional. VB.net is a very different program.
You may be able to get hold of a copy via ebay

Keith
 
K

Keith Willshaw

mike allen said:
this is my interpretation so far:
a full (not an upgrade), used version of Microsoft Visual Basic 6.0 from
ebay for $150-200 will allow me to essentially use the same code i am used
to using in excel/vba, but i will be able to create stand-alone programs
that others can use w/out excel. it will have matix's/spreadsheets for
input and output, i assume.

No sir. Your user will need to have Excel installed. The Excel specific
functions
are accessed via the Excel object dll's and you cannot distribute them.
you mentioned "Excel-specific functions." what are those? vlookup, match,
isnumeric, len, trim, count, counta are some of the functions i use often
in code. are these "Excel-specific functions?" thanks, mike allen

Any and all Worksheet Functions are Excel specific, this is very true
of Vlookup and Match which are reliant on values on the Excel
spreadsheet.

Keith
 
K

Keith Willshaw

mike allen said:
if the developer and the user both have to have excel, then why use Visual
Basic 6.0, etc., vs. just excel and vba?

Because then the user only gets the compiled code

i am just seeing if there is a way to present something more "professional"
by creating a stand alone program. most of my
applications/programs/customized spreadsheets (whatever they are properly
called) are very complicated w/ involved math, have no spreadsheet formulas
(only code), very protected from tampering, etc. and deserve more credit
than to be called "a spreadsheet" or "an excel file", which is what one of
my users calls it. in a way, he is right, but if it were stand-alone, it
would be the real thing: a bona fide program. how would you defend a very
involved set of macros, functions, etc. that happens to be contained in
excel, and what do you call this? a program, an excel application, an excel
file, a customized spreadsheet...? thanks, mike allen

I have exactly the same problem and use a com addin which is
a compiled dll instead of VBA

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dno2kta/html/mso2kaddin.asp

Keith
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top