Excel Vb to move a file to a shared network drive????

A

Angela

Hello, I have a simple excel vb file, and i am trying to have the file
moved, ** or ** copy/pasted to a network shared drive.

we have a network shared drive, called "WDdrop". any CSV, PAS, file
copied and pasted into this folder, will print a label to a designated
printer.
at the present, i have to use 'command buttons' to run the vb script
file, then copy the file to the WDdrop...
Here is an example of my VB file..... to make it easier to see the
lines of concern, I will tab them out some so they stick out!!!
:)

Sub os_id_4420()
'
' MACRO Macro
' Macro recorded 5/14/2004 by Dan
'
Dim LPType As String
Dim LP As String
Dim I As Integer
Dim theCell As Range
Dim theFile As Integer
Dim T2 As String
Dim N2 As String
Set theCell = Range("a1")

Open "c:\OS_ID.pas" For Output As #1
For I = 2 To 10000

Set theCell = theCell.Offset(1, 0)
LP = theCell.Value

If LP <> "" Then
LPType = theCell.Offset(0, 1).Value
T2 = theCell.Offset(0, 6).Value
N2 = theCell.Offset(0, 7).Value

Print #1, "*FORMAT,OS_ID.lwl "
Print #1, "*QUANTITY,1"
Print #1, "*PRINTERNUMBER,5"
Print #1, "task," & LP
Print #1, "name," & LPType
Print #1, "TASK2," & T2
Print #1, "NAME2," & N2
Print #1, "*PRINTLABEL"
os_id_2x1_4420.pas.movefile \\BLOCKP_5\WDDrop

Else
Close #1
GoTo Foo
End If

Next I
Foo:
em Open "C:\OS_ID_2x1_4420.PAS \\BLOCKP_5\WDDrop" For Output As #2
rem Copy "C:\OS_ID_2x1_4420.PAS \\BLOCKP_5\WDDrop"
rem Paste "\\blockP_5\WDDrop"
'rem Close #2

End Sub

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

So, I use the: Open "c:\OS_ID.pas" For Output As #1
statement to create a file called OS_id.pas on my local C:\ root.
and then i send the file to printer#5....
I would like to move the file to a network shared drive called:
\\block5\WDdrop.

I usually ahve to run a batch file with a simple line in it:

copy c:\osid.pas \\Blockp_5\WDDrop


is their a way to copy,or move this file to the network shared drive
and get around the 'wildcard' restrictions?
any and all help will be greatly dear to me.
 

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