Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 153
Default Message box to prompt for file name upon save

Greetings everyone. I have, among other things, the following lines in a
macro to save a worksheet

ActiveWorkbook.SaveAs Filename:= _
"\\MyURL\DAILY_PRODUCTION\NEW\test.txt" _
, FileFormat:=xlText, CreateBackup:=False

This works great, except that I don't want the file to be called "test" in
production. I need to have a dialog box pop up to ask me what to enter as
the name

I tried
....NEW\" & MsgBox & ".txt"

but it does not work. Any ideas?


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Message box to prompt for file name upon save

Maybe this,

But note I include no error checking for illegal filenames which you may
want to consider

response = InputBox("enter filename")
If response < "" Then
ActiveWorkbook.SaveAs Filename:="\\MyURL\DAILY_PRODUCTION\NEW" & response &
".txt" _
, FileFormat:=xlText, CreateBackup:=False
End If


Mike
"Greg Snidow" wrote:

Greetings everyone. I have, among other things, the following lines in a
macro to save a worksheet

ActiveWorkbook.SaveAs Filename:= _
"\\MyURL\DAILY_PRODUCTION\NEW\test.txt" _
, FileFormat:=xlText, CreateBackup:=False

This works great, except that I don't want the file to be called "test" in
production. I need to have a dialog box pop up to ask me what to enter as
the name

I tried
...NEW\" & MsgBox & ".txt"

but it does not work. Any ideas?


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 153
Default Message box to prompt for file name upon save

Mike, that worked like a charm, thank you.

"Mike H" wrote:

Maybe this,

But note I include no error checking for illegal filenames which you may
want to consider

response = InputBox("enter filename")
If response < "" Then
ActiveWorkbook.SaveAs Filename:="\\MyURL\DAILY_PRODUCTION\NEW" & response &
".txt" _
, FileFormat:=xlText, CreateBackup:=False
End If


Mike
"Greg Snidow" wrote:

Greetings everyone. I have, among other things, the following lines in a
macro to save a worksheet

ActiveWorkbook.SaveAs Filename:= _
"\\MyURL\DAILY_PRODUCTION\NEW\test.txt" _
, FileFormat:=xlText, CreateBackup:=False

This works great, except that I don't want the file to be called "test" in
production. I need to have a dialog box pop up to ask me what to enter as
the name

I tried
...NEW\" & MsgBox & ".txt"

but it does not work. Any ideas?


Reply
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
Prompt to Save Message Adam O Excel Discussion (Misc queries) 2 December 10th 08 08:22 PM
prompt user to save file as {desired_name} and save it to a variab GeneWan Excel Programming 1 January 5th 07 06:46 AM
Prompt message when opening a file Pernod Excel Worksheet Functions 1 October 13th 06 09:08 PM
Prompt Message when opening a file Pernod Excel Worksheet Functions 0 October 13th 06 08:09 PM
When i open my Excel file this message prompt: Gilles Chartier Excel Programming 2 December 3rd 03 12:51 PM


All times are GMT +1. The time now is 07:13 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"