Results 1 to 2 of 2

Thread: Solved, OP can delete it. Export part of excelsheet automatically

Threaded View

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2006
    Posts
    1

    Solved, OP can delete it. Export part of excelsheet automatically

    HI, all, I tried to export part of the excel sheet to a text file. I used the folowing code, With Application.GetSaveAsFilename(), someone has to click on the "SAVE" button in the pop-up window. Is there a way I can save the text file without the click?

    Thank you very much.

    Public Sub Dotheexport()
    Dim FName As Variant
    Dim Sep As String

    FName = Application.GetSaveAsFilename("C:\Documents and Settings\xyz\Desktop\Data.txt")


    If FName = False Then
    MsgBox "You didn't select a file"
    Exit Sub
    End If

    Sep = " "
    'Sep = InputBox("Enter a single delimiter character (e.g., comma or semi-colon)", _
    "Export To Text File")

    ExportToTextFile CStr(FName), Sep, _
    False
    End Sub
    Last edited by hufada; Jun 19th, 2006 at 10:31 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width