Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Save Excel Workbook Question

I have created a button which saves a workbook as a specified name. The code
is as follows:

Private Sub CommandButton1_Click()

Dim sFileName As Variant

With Application.Dialogs(xlDialogSaveAs)
.Show ("CurrentVersion")

End With

End Sub

What do I need to do to save the file automatically as a value in Cell A1,
instead of "CurrentVersion" and without having "SAVE AS" Dialogue Box
displaying?

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Save Excel Workbook Question

Try this:

Private Sub CommandButton1_Click()

Dim sFileName As Variant
sFileName = Worksheets("Sheet1").Range("A1")
'sFileName needs to include the path
'you can add it if necessary with the following
sFileName = "C:\temp\" & sFileName

ActiveWorkbook.SaveAs (sFileName)

End Sub
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
My CD won't let me save my Excel workbook on them? magster10 Excel Discussion (Misc queries) 1 March 31st 10 08:09 AM
Excel workbook will not save aussiegirlone Excel Discussion (Misc queries) 2 March 17th 09 07:00 AM
Simple question about FORM / SAVE & EXCEL Alex[_26_] Excel Programming 1 February 23rd 06 09:40 PM
save excel workbook waterworks Excel Discussion (Misc queries) 1 February 2nd 06 03:30 PM
Using interop.excel to open a workbook, the workbook doesn't ask to save changes. [email protected] Excel Programming 1 December 28th 05 10:23 PM


All times are GMT +1. The time now is 02:24 AM.

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"