dbTalk Databases Forums  

How to copy an excel file.

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss How to copy an excel file. in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Luis Esteban Valencia
 
Posts: n/a

Default How to copy an excel file. - 11-09-2004 , 11:07 AM






I need to copy a file into another file. I use this code but I dont get any
errors but I dont get the file copied neither.



Private Function RenombrarArchivoPresupuesto()

'On Error Resume Next

Dim archivo

Dim f

Dim f1

Dim fc

Dim fso


Set fso = CreateObject("Scripting.FileSystemObject")

Set f = fso.GetFolder(strRutaPresupuestos)

Set fc = f.files

For Each f1 in fc

archivo = f1.name

if Left(archivo, 4) = Ano Then

fso.CopyFile strRutaPresupuestos & archivo, strRutaPresupuestos &
"CargaPresupuestoDireccion.xls"

exit function

End if

Next

Set fso = Nothing

End Function



--
LUIS ESTEBAN VALENCIA
MICROSOFT DCE 2.
MIEMBRO ACTIVO DE ALIANZADEV



Reply With Quote
  #2  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: How to copy an excel file. - 11-09-2004 , 03:05 PM






I would MsgBox out all your variables first to make sure that what you think
is being passed IS being passed. If you still think it looks OK then pug in
what the MsgBoxs give you directly and see if it works.

--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.Konesans.com


"Luis Esteban Valencia" <luisvalen (AT) haceb (DOT) com> wrote

Quote:
I need to copy a file into another file. I use this code but I dont get any
errors but I dont get the file copied neither.



Private Function RenombrarArchivoPresupuesto()

'On Error Resume Next

Dim archivo

Dim f

Dim f1

Dim fc

Dim fso


Set fso = CreateObject("Scripting.FileSystemObject")

Set f = fso.GetFolder(strRutaPresupuestos)

Set fc = f.files

For Each f1 in fc

archivo = f1.name

if Left(archivo, 4) = Ano Then

fso.CopyFile strRutaPresupuestos & archivo, strRutaPresupuestos &
"CargaPresupuestoDireccion.xls"

exit function

End if

Next

Set fso = Nothing

End Function



--
LUIS ESTEBAN VALENCIA
MICROSOFT DCE 2.
MIEMBRO ACTIVO DE ALIANZADEV





Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.