LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 92
Default Using a TextBox value in a file String

I have the following code ina standard module, the user can enter there own
file name via a form.

Sub The_SubSave()
Dim fName As String
fName = frmOptions.TextBox1.Value
If frmOptions.CheckBox2.Value = False Then
ActiveWorkbook.SaveCopyAs "C:\AutoSaves" & "fName" _
& "." & Format(Date, "dd-mmm-yyyy") & "." & Format(Time, "hh-mm-ss") &
".xls"
Else
ActiveWorkbook.SaveCopyAs "C:\AutoSaves\DDE Sheet" _
& "." & Format(Date, "dd-mmm-yyyy") & "." & Format(Time, "hh-mm-ss") &
".xls"
End If
StartTimer

End Sub

The problem is if the checkbox is false the first if statement which include
the textbox value as part if the file path does'nt work.

Ive trie placing in( ) and " " of having the tectbox in the string but it
does not wok!
The Else option works fine!
Does anyone have any suggestions

Thanks in advance for any help
 
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
textbox to file (.txt or .doc) Kagan Clearwater Excel Programming 1 November 28th 06 06:07 AM
need to add string to txt file Leech Excel Programming 0 February 7th 06 01:34 PM
HELP! I Lost The Ability To Advance From TextBox To TextBox With the ENTER Or The TAB Keys Minitman[_4_] Excel Programming 0 February 22nd 05 08:50 PM
Retaining value of a string from a textbox on a form ?? Dan Thompson Excel Programming 6 October 28th 04 09:00 PM
Textbox & Save file problem Stuart[_5_] Excel Programming 0 August 4th 04 07:09 PM


All times are GMT +1. The time now is 05:30 PM.

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

About Us

"It's about Microsoft Excel"