Archive

Posts Tagged ‘Basic’

Visual Basic 6 (VB6) Code to Put Data in an Excel Spreadsheet

June 15th, 2005

The following Visual Basic 6.0 (VB6) subroutine will show you how to
write data into Microsoft Excel spreadsheet cells from your
program.

As with all my sample code, it’s provided as-is without
warranty or support.  Use at your own risk.

Read more…

admin VB and VBScript , , , , , , , , , , , , , , , , , , , , , ,

VBScript Function to Determine if a Registry Entry Exists

June 15th, 2005

The following function, when called with the path to a Windows
Registry entry, will attempt to tell you if that entry exists in the
Registry of the system it’s running on.

For example, you might
call it as follows:

theEntry =
“HKLM\Software\Microsoft\Internet Explorer\Main\Start Page”
if regEntryExists(theEntry) then
   msgbox “That
Registry Entry exists.”
else
   msgbox
“That Registry Entry doesn’t exist.”
endif

The function returns a true or false
Boolean response.  True if the Registry entry exists, False if it
doesn’t.

Read more…

admin VB and VBScript , , , , , , , , , , ,

VBScript “Sleep” Function

June 15th, 2005

Sometimes during a VBScript, you need the system to “go to
sleep” for a little while so that you can wait for something to
happen.  For example, you might want to start a process running and
give it 30 seconds to finish before you do something else, or you might
want check a given directory for a file every minute or so. 

Read more…

admin VB and VBScript , , , , , , , ,

VBScript Subroutine to Split Up a Tab-Delimited Line of Text

June 15th, 2005

This VBScript function returns an array when given a line of
tab-delimited text.

To use it, write a line of code like the
following:

Dim theArray()
theText =
“something tab delimited”
theArray =
tabsplit(theText)

As with all my script code,
this is provided as-is without warranty or support.  Use at your
own risk.

Read more…

admin VB and VBScript , , , , , , , , , , ,

Send an Email Via Outlook from VB or VBScript

June 15th, 2005

The VBScript code below will send an email message through Microsoft
Outlook (the Exchange Server version, it probably won’t work with
Outlook Express) when you call it from your script.  Using this
subroutine you can customize the subject and content of the mail message
as well as its recipients.

To use it, the syntax
is:

  mailThisMessage toAddress,
bccList, ccList, subjectLine,
theMessage

where:

toAddress is the email
address you want to send the message to (use “;” for multiple
addresses)

bccList is the list of email
addresses you want to “bcc” the mail message to via Outlook

ccList is the list of
email addresses you want to copy the mail message to via Outlook

subjectLine is the subject line
of the message you’re sending via Outlook

theMessage
is a text field containing the actual message you want to send, in HTML
format, via Microsoft Outlook mail

As
with all my scripts and code, this is provided without warranty or
support.  Use at your own risk.

Read more…

admin VB and VBScript , , , , , , , , ,