Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default How to save a file

Dear all,

I want to place a button in a worksheet, which will ask for
a filename, after the user input the
filename, I want to save the file to a particular directory, how can I
do that? I do not want to use the common dialog box. I want to use an
inputbox which ask for filename, after the user input filename in
inputbox, then I will immdeately save the file, what is the function to
set the saving directory and what is the function to save(write) a
excel file?

Thanks.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default How to save a file

Hi Hon123456,

Try something like:

'================
Public Sub Tester()
Dim WB As Workbook
Dim SH As Worksheet
Dim res As String
Const sPath As String = "C:\aFolder\" '<<=== CHANGE

Set WB = ActiveWorkbook '<<=== CHANGE

res = InputBox("Please enter new file name")

WB.SaveAs Filename:=sPath & res, _
FileFormat:=xlWorkbookNormal

End Sub
'<<================

Note that no error checking has been included.


---
Regards,
Norman


"hon123456" wrote in message
ps.com...
Dear all,

I want to place a button in a worksheet, which will ask for
a filename, after the user input the
filename, I want to save the file to a particular directory, how can I
do that? I do not want to use the common dialog box. I want to use an
inputbox which ask for filename, after the user input filename in
inputbox, then I will immdeately save the file, what is the function to
set the saving directory and what is the function to save(write) a
excel file?

Thanks.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default How to save a file

Thanks for your help

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
SAVE and SAVE AS options disappeared from the drop down FILE menu [email protected] Excel Discussion (Misc queries) 2 July 12th 07 09:14 AM
Excell2003 (SP-1) File > Save and File > Save As.. grayed out Joe Murphy Excel Discussion (Misc queries) 0 March 9th 05 10:00 PM
Excel marcos firing on file save as but not file save Andy Excel Programming 1 August 3rd 04 10:34 AM
Save File to Another Directory, but not change Users File Save location Mike Knight Excel Programming 1 May 28th 04 09:06 PM
Save As - Multiple Sheets fails to save as text file Ravee Srinivasan Excel Programming 2 November 10th 03 04:05 PM


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