No of visitors who read this post: 216
Category: Visual basic
Type: Question
Author: G Brown
No votes yet

Hi All,

This code is for zipping files in a folder and get this error

---------------------------
Windows Script Host
---------------------------
Script: F:\Zip.vbs
Line: 6
Char: 1
Error: Type mismatch: 'strWinzip'
Code: 800A000D
Source: Microsoft VBScript runtime error
 
---------------------------
OK   
---------------------------
 
strDate = Year(Date) & Right("0" & Month(Date), 2) & Right("0" & Day(Date), 2) & Right("0" & Hour(Now), 2) & Right("0" & Minute(Now), 2) & Right("0" & Second(Now), 2)
strFolderToZip = "F:\test"
strZipFileToCreate = "F:\test\Subfolder_" & strDate & ".zip"
strWinzip = "C:\Program Files\WinZip\Winzip32.exe"
Set objFSO = CreateObject("Scripting.FileSystemObject")
strWinZip objFSO.GetFile(strWinZip).ShortPath
strCommand = strWinzip & " -min -a -r """ & strZipFileToCreate & """ """ & strFolderToZip & """"
objShell.Run strCommand, 1, True
MsgBox "Done"
 
 
Can anyone help please

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

#

    Hi there. I always encounter that type of error – type mismatch. When I go back to my codes,  it seems that there is nothing wrong with it. If the data type of the variable, which will be the value to be inserted to the database, does not match the data type of the column where that variable should be inserted there will be an error. For example you will insert an IDno variable of type character from the program to the IDno column of type integer in the database an error will occur. If the values are not compatible, there is a type mismatch error.