run time error vb6 Results

Page 1 of 2.
Results 1...20 of 31

Sponsored Links:

Have run into a buzz saw. I have a vb6 program that uses some Crystal reports. Tried to install on a dell 8300 xphome system. When trying to access the reports, I get this error: Run time error '-2147206429(80043ae3)': Invalid TLV record.

Have had no problems when installed on a dell inspiron xphome or any other system.

I have reviewed mrabrams post 97088 and it seems that the report should behave consistently over all platforms, which it did not.

Any help would be great. Even to idenify the 'invalid TLV record' part.

I have code that instantiates Excel, opens a workbook, makes some changes, saves the workbook and closes Excel. What I am looking for is a way to control error handling that occurs within Excel. For example if the workbook that my code opens has some bad code within it that triggers a run-time error I would like to handle the error in my code so that no user intervention is required.

I can use either VB.Net or VB6 for my code. I'd prefere to use VB.Net using Interop for calling the Excel COM object but if there is a VB6 only soloution I am open to it. I had considered .Net Delegates but if I understand them correctly I can't assign a .Net delegate to a method within any of the Excel code modules.

Any ideas?

I wrote a short applicaiton that will display all the requests where the status does not equal "Finished". This was working fine for about threee months. Now I am gett Run time Error - 3001. - Invalid Argument.

Daniel Reyes

Pardon my terminology as I'm new to Visual Basic.

I am having trouble with a pop-up calendar that I created in an Excel 2003 worksheet . I linked the macro to the worksheet itself rather than to my personal.xls because the Excel document is to be used as a template for multiple users, each of whom will need the pop-up calendar feature.

I saved the spreadsheet on our network as a workgroup template (both as a .xls and a .xlt ,in case it matters, but my problem persists in both).

I then opened the file on each of the user's computer in turn. On some computers, the pop-up calendar runs fine, so on those machines, I created a shortcut to the calendar on the Excel Standand toolbar. (As an added benefit, the pop-up calendar feature now is available to those users on any other Excel spreadsheets they open.)

However, on a number of machines, I am getting a run-time error and the error is the same on each:
Run-time error "_2147319765 (8002802B)'
Method "Value" of object
'_DMscal70' failed

Debugging highlights the line of code: frmCalendar.Show
in the Module 1 Screen under:
General Open Calendar
Sub OpenCalendar ()
End Sub

I don't know what this means or how to fix the problem. I'd really appreciiate any guidance you would offer.


(Edited by HansV to provide link to post, and to indent using [tab] tags - see Help 19. Also removed superfluous line ends - the browser will wrap lines automatically.)

I have a report which runs fine on the machine on which the program was developed but when packaged and installed on another machine I get: 'Run Time Error -2147220992 (80040200). Provider cannot be found. It may not be properly installed.'

The report is associated with a Data Environment and the associated code is:

Private Sub mnuFileReport_Click()
If deEnvName.rsRecSet.State Then 'If open, close for update
End If
deEnvName.rsRecSet.CursorLocation = adUseServer

End Sub

I am a beginner and have struggled to get this far. I have searched the lounge and find this is similar to post 144694. However, the link with the answer doesn't work any more.

I assume a program that is on my machine doesn't exist on the target machine and is not being included in the installation package.

Thanks in anticipation.

I am trying to write a Word mail merge application in Visual Basic 6. The 'normal' merge to a new document goes fine, but l also need to merge some documents to email - where the patient has an email address.
The email merge goes fine up to the actual 'execute' statement where l get the following error message:

Run-time error '5603'
Word cannot merge documents that can be distributed by mail or fax without a valid mail address. Choose the Setup button to select a mail address data field.

If l then switch to the Word document, and display the 'Mail Merge Wizard', it's got to step 3, where you select recipients. l then click on the 'Match Fields' button on the MailMerge toolbar, and l can see that my email field has been selected as the email address, even though the error message above seems to be indicating that it hasn't.
Below is the code l am using:

'add an email field to the beginning of the doc
Dim rng As Word.Range
Set rng = ActiveDocument.Range
rng.Collapse Direction:=wdCollapseEnd
ActiveDocument.Fields.Add rng, wdFieldMergeField, """E-mail_Address"" m"

'start the email mail merge
MainDoc.MailMerge.MailAddressFieldName = "E-mail_Address"

MainDoc.MailMerge.MailSubject = "WordLetters Email"

MainDoc.MailMerge.MainDocumentType = 4 'wdEMail

MainDoc.MailMerge.OpenDataSource Name:=sbDbaseName, _
LinkToSource:=True, Connection:="DSN=WordLetters;DATABASE=" & sbDBPath _
& ";UID=" & sbUserID & ";PWD=" & sbPWD, _
SQLStatement:="SELECT * FROM WordMergeQueryEmail", subtype:=8 'wdMergeSubTypeWord2000

MainDoc.MailMerge.Destination = wdSendToEmail

With MainDoc.MailMerge.DataSource
.FirstRecord = -1
.LastRecord = -1
End With

MainDoc.MailMerge.Execute Pause:=False

' remove the temporary email field from the document
ActiveDocument.Fields.Item(ActiveDocument.Fields.C ount).Delete

The only thing that isn't obvious from the code is that there is a reference in the project to Word 9, but because l need to run this in either 2000 (Word 9) or 2002 (Word 10), l have used late binding in the procedure to make the program use the correct reference, so that l can add, for example, 'subtype' to the OpenDataSource without VB having a wobbly.

After using MSCAL.OCX for a few days now, I'm going to trash it out of my application.

Run-time errors and the such have convinced me of the in-efficienct of this control.

Does another control exist, or an add-in which I can implement which is not ActiveX,OCX ?

I am writing a small program to populate an excel spreadsheet.
Items are sent out and the program finds the corresponding entry
in the spreadsheet and enters the date sent and who it was sent to.
When the item is returned the program records who it came from
and the date it was returned.

As long as the "find" finds a match - no problem - if there is
NO match I get Run-time error 91
Object variable or With block variable not set.

Code section is below

For i = 0 To 14
intCol = 1
If strDieIn(i) "" Then
Cells.Find(What:=strDieIn(i), After:=ActiveCell, _
LookIn:=xlValues, LookAt:= xlPart, _
SearchOrder:=xlByRows, SearchDirection:=xlNext, _
intRow = ActiveCell.Row
Cells(intRow, intCol).Select
With Sheets("AllTheDies")
.Cells(intRow, intCol + 3).Value = theDateIn
.Cells(intRow, intCol + 4).Value = "YES"
.Cells(intRow, intCol + 5).Value = cboInVendor
.Cells(intRow, intCol + 7).Value = theDateIn
End With
End If
Next i

What to do?

(Edited by HansV to make URL clickable - see Help 19)

We use a very old macro from slipstick call My Outlook Calendar ( that makes a nice, easily updated web calendar from our Outlook calendars. Even though it is a Word 98 macro, it still works fine with Word 2003. Or it did, until yesterday. Yesterday we discovered a bunch of virus infections and installed Symantecs latest Norton Internet Protector 2006. It cleared a bunch of stuff. But now My Outlook Calendar won't run any more.

When you run MyOlCal (it's a word template with embedded macros) you get the typical dialog asking if you want to enable the macros. When you do enable them it sits a moment and then you get a dialog box stating " Run time error '-2177024770(8007007e)'; Automation Error, the specified module could not be found". It then offers End or Debug buttons. I don't know much about debug but when you choose that the editor seems to indicate it is looking for a module named My.Show which cannot be found. I tried reloading MyOlCal and also the VB6 runtimes. None of that helped.

Oh, the machine with this problem has both Word 2000 and Word 2003. Same thing happens with both/either.

Any idea what I can do?

The following works on Windows 2000 machine, on Windows 95 but fails on WIndows ME

SQLText = "SELECT Format([Route Date],'mmm-yy') AS [MonthsDate], Format(Sum(Routes.Distance), '#.0') AS MilesWalked, Format (Sum(Routes.Climb), '#,##0') AS FeetClimbed FROM Routes WHERE (((Routes.[Route Date])>#12/31/1998#)) GROUP BY Format([Route Date],'mmm-yy')ORDER BY Sum(Routes.Distance) DESC , Sum(Routes.Climb) DESC"

It populates a flexgrid control, when it works, but on the ME machine I get a Run Time error "ODBC call failed". If I simply select Route Date with no formating the ODBC call succeed.

All three machines run the same versions of access 2000, ME & 95 appear to have the same version of Access ODBC driver.

Any ideas would be appreciated

My VB 6 application is a stand-alone program and is running fine in a Windows 98 and Windows XP environment. However, when the program was run in a Windows Me computer yesterday, I obtained the dreadful error message:

"Run-time error '3211'; The database engine could not lock table 'Items' becuase it is already in use by another person or process".

The Windows Me computer wasn't networked and it was started from a cold boot. Re-installing he program didn't help.

The error occurred at the line when a dBase III file was loaded (linked) in a MS Access database. Apparently the dBase III file couldn't be accessed though it was there and no one was accessing it.

I was told the computer has millennium problem and was attacked by virus before.

I suspect the problem is related to the Windows Me system or the virus. Can anyone help?

I've created a small calender application in VB6 that uses automation of Outlook 2002 (XP). It syncronizes copies appointments from personal calendars into a shared department calendar. I recently upgraded to Office 2003 and my application now experiences errors in some Outlook Automation calls.

For example, attempts to read the 'Companies' property of the Outlook.AppointmentItem returns:

"Run-time error '-2147221233 (8004010f)': Method 'Companies' of object 'AppointmentItem' failed"

Same thing occurs with the 'BillingInformation' property. I use these properties to store sync data with the appointment. As far as the Outlook 2003 documentation is concerned, these properties are still there.

Anyone have any experience with this?

I've included error trapping in my start form.

I trapped two errors - 71 & 76

At the start of my code before the declarations I added:

On Error GoTo ErrHandler

Code starts here......................

At the end of the code I added:

Me.MousePointer = vbDefault

If Err = 76 Or 71 Then MsgBox "You Must Exit This Program Now, " & vbCrLf & _
"Please Insert The Installation Disk Into Drive D:" & vbCrLf & _
"And Re-Run This Program.... " & vbCrLf & _
vbCrLf & "Required Files Need To Be Loaded Before This" & vbCrLf & _
"Program Can Run.", vbCritical, "Error" & " " & _
Err.Number & " " & Err.Description
Me.Text1 = ""
Me.Label1.Caption = ""

When running the program, the err trapping returns the msgbox and error No 0 evry time it is run, whether or not the disk
or file exists.

Can any-one see where the problem lies ?

I just built an application in VB using a Access 97 back end. I created an installation package using the package and deployment wizard. I had no problem installing it on my test computer (just a generic computer that does not have VB installed). There was a point where the installation program stated that I had to install a component then reboot my computer. I clicked okay and rebooted my computer and ran the installation program again. It worked fine.

On two other computers, it asked the same question, we did the same thing...but after the computer rebooted and I started the install again, it asked the same question again. Each subsequent time it would do this and never let us complete the installation.

Has anyone else had this problem and figured out the solution?

Something else probably worth mentioning:

On the machines that I've been able to successfully install this thing on, during the installation it tells me that the file I'm trying to copy is older than the one on the destination machine (or something like that). The file names are as follows:


In VB I am running SP4 (didn't want to load SP5 because I've heard some questionable things about it, but I shouldn't have to I don't think). Is there something else I might have missed on my initial installation of VB? I've had it installed and have been using it for several months.


I want to determine which file was selected from a DirListBox and FileListBox and return this value to a textbox.

My code looks like this:

Option Explicit
Dim mFso As New FileSystemObject

Private Sub dirDirectory_Change()
filFile.Path = dirDirectory.Path
End Sub

Private Sub filFile_Click()
Dim theFile As File

TextBox.Text = ""

Set theFile = mFso.GetFile(filFile.Path & " " & filFile.List(filFile.ListIndex))

TextBox.Text = theFile
End Sub

Now although the code compiles okay, at Run Time I get a file not found error. I have Microsoft Scripting Runtime checked and have been over this code a dozen times and can't see what's wrong with it. So what am I missing please?

Many thanks

I want to launch an access mde file using a specific mdw file from a VB application. Using the Shell function I have had a problem on a one or two PCs launching Access which then gives an error message "system error or not enough free memory to run this application". Has anyone else had good or bad experiences using the shell function it seems to work Ok on most PCs.

The construct I am using is

dim varret
dim strPath

strpath ="C:Program FilesMicrosoft OfficeOfficeMSACCESS.EXE" "Data FilesAppFolderAppFile.mde" /wrkgrp "Data FilesAppFolderSmSt.mdw" /user SysAdmin/Pwd wiggle"
varRet = Shell(strpath, vbMaximizedFocus)

Maybe this is not the right function to use in these circumstances. If I paste the file path in to a shortcut it works OK on all PCs

My colleague is using this simple vb app to run an access 97 project he is distributing as run time application. It worked OK on his PC and lap top for a while. He has now used Wise Install to build a distribution package. It worked ok on his machines for the first two or three builds of the set up script but now it gives this error message. It is giving the message on about 50% of the installations on W98 and NT4

Can anyone help me with this as our clients don't reckon much to it!

How do I determine the whole-day part of a date? I have used dateVar.Hour to find the 0-23 hour in the day, but the day part has me stumped. In VB6 or VBA, I would use Int(dateVar), but that expression causes a run-time error. Tried CInt() and CLng, but they will not compile. Tried dateVar.Date and dateVar.DayOfYear without success.


My organization uses VBA code running under Microsoft Word to do a lot of automated processing of documents. As we have added more and more features the size of the file that contains the macro code has grown as well (it is now over 600k). A few weeks ago I added some functionality to the code and released it to the users. Ever since, some users have been (intermittently) getting an error that says "Run-time error'-2147417848 (80010108)'; Automation Error The object invoked has disconnected from it clients."

The strange thing is, this error occurs when the users are using a part of the code that was not changed in the last release. I can temporarily clear the problem by rebuilding the template file (thus removing any custom macros or autotext that they may have added) or deleting the 'HKEY_CURRENT_USERSoftwareMicrosoftOffice9.0WordDa ta' key from the registry (this also has the effect of removing some of the customization the user might have made). Because of this, I think the problem may be related to the size of the template.

My assumption was that the size was too large (over 600k) so, using VB6, I created a DLL and started shifting forms and common functions over to the DLL. Then I started removing forms and functions from my VBA code in the template file. Now when I need to use the function or form I call it from the DLL. By doing this I was able to bring the size down from 616k to about 513k. I pushed the new version out to my users on July 10th and so far the problems I was having have disappeared.

Has anyone else had this type of problem? Is there an easier or better way to fix it?

Thanks for the help.


First time posting. I've recently been trying to install a game written in VB6 primarily for Windows XP, which did run fine in Vista x64.

On installing I receive the following error message;
"The file 'C:Windowssystem32stdole2.tlb' could not be opened. Please check your disk is not full and that you have access to the destination directory"

So following the instructions of a member of the game's forum, I took ownership of the stdole2.tlb file setting it as Computer/Administrators, and then run the installer exe as administrator, but still received the same error every time. I've tried setting the ownership to my user login rather than administrator with the same results, and set the user and administrator read/write priveliges to the file and whole folder still with no luck.

The game's designer says this isn't a problem they're prepared to help with as it's a Windows 7 user priveliges issue

I've hunted high and low for answers, and I need your help

Hi All

I have written a piece of code that finds the mac address of a computer and then sends it through my network to a folder and appends it to a csv file. This is to help automate the issue of collecting mac addresses for the technical team who are doing a massive roll out of new PC's to the company. Currently they are writing them down on pieces of paper and then emailing them to the system administrator. As you can imagine, a very, very laboriuos task.

My project works fine if you are logged on to the network but the problem is the tech guys are logging in locally as the Administrator (Win 2000). When they run the application an error message comes up saying the network folder cannot be found (Obviously as they are not logged into the network). Is there a way I can change this code so that the network can be found (whilst in Administrator) to pump this data through to a csv file. My code reads as follows(cut down):

Dim Mac As String
Dim iFile as integer
Dim Primary

Mac = txtMac 'Contents of text box on user form
Primary = Format(Now(),"yymmddhhmmss") 'time stamp
Open "MyCSV File location on the network" for Append AS #iFile
Write #iFile,Primary,Mac
Close #iFile
End Sub


Page 1 of 2.
Results 1...20 of 31