PC Review


Reply
Thread Tools Rate Thread

create .csv and thn FTP tht file

 
 
vishakha.ranjeeta@gmail.com
Guest
Posts: n/a
 
      13th Jan 2009
I am trying to create an excel file that has a command button that
saves the file on desktop as .csv but everytime by clicking on the
command button it is changing the name of my active excel sheet and
saving on the desktop.
below is the code:-

Private Sub CommandButton1_Click()
Call SaveToDesktop
End Sub
Sub SaveToDesktop()
Dim DTAddress As String
DTAddress = CreateObject("WScript.Shell").SpecialFolders
("Desktop") & Application.PathSeparator

ActiveWorkbook.SaveCopyAs DTAddress & "1 EDSPubVMIActivity 852_1
200000080.csv", FileFormat:=xlCSV, CreateBackup:=False
End Sub

then further I have connect this file to internet and FTP it could you
please help with the above problem ?
its urgent


 
Reply With Quote
 
 
 
 
Joel
Guest
Posts: n/a
 
      13th Jan 2009
The best way is to make a copy of the worksheet and save the copy like this.
I closed the CSV file after the Copy was made. Excel always changes the
filename whereever you do a saveas.

Private Sub CommandButton1_Click()
Call SaveToDesktop
End Sub

Sub SaveToDesktop()
Dim DTAddress As String
DTAddress = CreateObject("WScript.Shell").SpecialFolders
("Desktop") & Application.PathSeparator

set NewBk = ActiveSheet.copy

NewBk.SaveAs DTAddress & "1 EDSPubVMIActivity 852_1
200000080.csv", FileFormat:=xlCSV, CreateBackup:=False
NewBk.close savechanges:=False
End Sub


"(E-Mail Removed)" wrote:

> I am trying to create an excel file that has a command button that
> saves the file on desktop as .csv but everytime by clicking on the
> command button it is changing the name of my active excel sheet and
> saving on the desktop.
> below is the code:-
>
> Private Sub CommandButton1_Click()
> Call SaveToDesktop
> End Sub
> Sub SaveToDesktop()
> Dim DTAddress As String
> DTAddress = CreateObject("WScript.Shell").SpecialFolders
> ("Desktop") & Application.PathSeparator
>
> ActiveWorkbook.SaveCopyAs DTAddress & "1 EDSPubVMIActivity 852_1
> 200000080.csv", FileFormat:=xlCSV, CreateBackup:=False
> End Sub
>
> then further I have connect this file to internet and FTP it could you
> please help with the above problem ?
> its urgent
>
>
>

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I create a .bat file to create a shortcut on the desktop? Jenny Microsoft Excel Programming 0 19th Sep 2008 02:39 PM
Can not create a new file with File.Create -- throws exception:Access Denied thephatp Microsoft C# .NET 4 30th Mar 2008 03:48 PM
Solution to: Can't create file:.xls. Right click folder you want to create the file in and then click properties on the shortcut menu to check your permissions on this folder Ky_fanatic Microsoft Outlook Discussion 1 8th Dec 2006 06:15 PM
Drag and drop to create a link to a file in a cell of an Excel file paulaugust2003@yahoo.com Microsoft Excel Discussion 2 18th Sep 2005 03:44 PM
Which of your products can be used to create / burn a web to a cd or dvd and also create an autostart file / cd? Windows XP New Users 5 18th Jul 2005 06:47 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:39 AM.