I have a sub checking to verify that the file I want to put into a zip file is 
there…..if it is there, then it calls upon this sub. 

 

When it reaches this sub, I get a message that says “Compile error: Wrong 
number of arguments or invalid property assignment”

 

Here is my code:

 

Sub checkFile()

Dim fileExists As Boolean

'yesterDate = Format(DateAdd("d", -1, Date), "MMDDYY")

Set fso = CreateObject("Scripting.FileSystemObject")

If fso.fileExists("p:\test.txt") Then

main

Else

SendMail "[email protected]", "No file for RAD NPR!!!", "No file for 
rad npr", "[email protected]", "", "mail.haysmed.com", "", ""

End If

Shutdown = True

End Sub

 

Sub main()

NewZip "p:\test.zip" 'This creates the empty zip file.

FillZip "p:\test.zip", "p:\test.txt" ' This puts text.txt into the empty zip 
file

End Sub

 

 

Any ideas? Thanks,

 

--------------------------------------------------------------------

Heather Castillo
HPMIN Analyst/Module Coordinator
Information Systems
Hays Medical Center
785.623.5084 office

785.623.5594 fax
<mailto:[email protected]> [email protected]

"Shoot for the moon...even if you miss, you'll always land among the stars."

________________________________

From: [email protected] [mailto:[email protected]] 
Sent: Tuesday, January 13, 2009 8:39 AM
To: [email protected]
Subject: [talkbws] RE: .Zip file question

 

Greetings,

If I remember correctly, you need to use the below routines like commands 
within a third routine. Any routine that accepts parameters cannot be run on 
their own – sort of like telling someone to jump but not saying how high.

 

Take the example code from the website, paste into a project. Then create 
another routine that uses the below.

 

Sub main()

NewZip "c:\test.zip" ‘ This creates the empty zip file. 

FillZip "c:\test.zip", "c:\test.txt" ‘ This puts text.txt into the empty zip 
file

End Sub

 

Regards,

Thom

 

 

Thom C. Blackwell

Product Manager

Boston Software Systems

(866) 653-5105 ex 807

www.bossoft.com <http://www.bossoft.com/> 

Sign up for my weekly webinar! 
<http://www.bostonworkstation.com/customer_center/special_events.aspx> 

 

LEGAL NOTICE Unless expressly stated otherwise, this message is confidential 
and may be privileged. It is intended for the addressee(s) only. Access to this 
E-mail by anyone else is unauthorized. If you are not an addressee, any 
disclosure or copying of the contents of this E-mail or any action taken (or 
not taken) in reliance on it is unauthorized and may be unlawful. If you are 
not an addressee, please inform the sender immediately, then delete this 
message and empty from your trash.

 

From: [email protected] [mailto:[email protected]] 
Sent: Monday, January 12, 2009 2:20
To: Talk
Subject: [talkbws] .Zip file question

 

Hi everyone,

 

Does anyone have an in-production example of creating a compressed zipped file? 
I found the code below in the script center, but when trying on my PC, I pushed 
F8 to step through and all it does is make a noise and sit on the same line. It 
doesn’t step into the code. I have also never written a script that passes the 
parameter like that (in the sub definition). Am I missing a parameter/variable 
definition? Any complete in-production examples would be appreciated. 

 

http://www.bostonworkstation.com/customer_center/script_center/script_details.aspx?id=303&cat=20

 

Sub NewZip(sPath)

'Create empty Zip File

    Dim oFSO, arrHex, sBin, i, Zip

    Set oFSO = CreateObject("Scripting.FileSystemObject")

    arrHex = Array(80, 75, 5, 6, 0, 0, 0, _

                   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)

    For i = 0 To UBound(arrHex)

        sBin = sBin & Chr(arrHex(i))

    Next

    With oFSO.CreateTextFile(sPath, True)

        .Write sBin

        .Close

    End With

End Sub

 

Sub FillZip(ZipFile, addFile)

    Set oApp = CreateObject("Shell.Application")

    oApp.NameSpace(ZipFile).CopyHere addFile

End Sub

 

--------------------------------------------------------------------

Heather Castillo
HPMIN Analyst/Module Coordinator
Information Systems
Hays Medical Center
785.623.5084 office

785.623.5594 fax
[email protected]

"Shoot for the moon...even if you miss, you'll always land among the stars."

 

見-jgabٚ[hdn,\f(rz{e˛mZإgr˛m觶hz{^躼nȭzm'Š֭ܢoܺhz{^ۚ 躛ZF
Important:  This email and any attachments may contain confidential information 
subject to protection under the Federal Standards for Privacy of Individually 
Identifiable Health Information (45 C.F.R. Parts 160 and 164).  If you or your 
organization is a “Covered Entity” under the above mentioned regulations, you 
are obligated to treat such information in a manner consistent with the 
regulations.  If it appears that this email was sent to you in error, (1) you 
are prohibited from utilizing or disseminating this email or any attachments; 
(2) please immediately delete it from your computer and any servers or other 
locations where it might be stored, and email this sender or call the Hays 
Medical Center Privacy Officer at (785) 623-2188 advising that you have done 
so.  We appreciate your cooperation.
---
To post a message to this list, send mail to: [email protected]

You are currently subscribed as: [email protected]

Unsubscribe in the customer center on our website: 
http://www.bostonworkstation.com/customer_center/virtual_user_group_talk.aspx 

Reply via email to