LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
NFL NFL is offline
external usenet poster
 
Posts: 31
Default Problem With Code...Still

I posted a message earlier and been trying to figure out why this code
doesn't work right. Thank you for all your help.

Private Sub CommandButton6_Click()

Dim message As String
Set MyComputer = CreateObject("Scripting.FileSystemObject")
FolderName1 = Range("F6")
FileName1 = Range("M6")
If MyComputer.FolderExists(FolderName1) = False Then
message = MsgBox("The directory: " & FolderName1 & ", does not
exist." & Chr(10) _
& "Enter a new directory path (cell F6).", 0, "Not today my friend.")
Else
If MyComputer.FileExists(FileName1) = True Then
message = MsgBox("The file name: " & FileName1 & ", already
exists." & Chr(10) _
& "A copy of this file has NOT been saved.", 0, "Not today my
friend.")
Else

Sheet18.Visible = xlSheetVisible
Sheets("Export").Copy
ActiveWorkbook.SaveAs Filename:=FileName1, FileFormat:=xlNormal

With Workbooks(FileName1).Sheets(1).Cells
.Value = .Value
End With

ActiveWindow.Close
End If
End If

End Sub
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with code (error code 9) Vince Excel Programming 3 October 12th 09 04:16 PM
Code causes a problem Patrick C. Simonds Excel Programming 1 October 5th 09 08:50 PM
VBA Code Problem Shawn Excel Programming 9 July 19th 05 04:48 AM
Code Problem TC[_8_] Excel Programming 8 November 30th 04 07:09 PM
Problem with VBA Code? Steve[_71_] Excel Programming 7 November 1st 04 03:39 PM


All times are GMT +1. The time now is 07:08 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"