Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro - File Save As

I'm using the macro below to save a file after clicking a button to
certain cell value. I've moved the start file to a different folder
but the saved version go back to the old one. I can't figure out wh
that is based on the info in the macro.


Sub SaveAs()

Dim a_str1 As String
Dim sname As String

a_str1 = ActiveSheet.Cells(5, 2).Value

sname = Trim(a_str1) + Trim(b_str1) + ".xls"

ActiveWorkbook.SaveAs Filename:=sname, _
FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=Fals

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Macro - File Save As

I'm not sure what's in a_str1, b_str1, but if you specify the folder you want to
save the workbook to, it might be easier and safer.

ActiveWorkbook.SaveAs Filename:=thisworkbook.path & "\" & sname, _
FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False

If I understood correctly.

"tucopup <" wrote:

I'm using the macro below to save a file after clicking a button to a
certain cell value. I've moved the start file to a different folder,
but the saved version go back to the old one. I can't figure out why
that is based on the info in the macro.

Sub SaveAs()

Dim a_str1 As String
Dim sname As String

a_str1 = ActiveSheet.Cells(5, 2).Value

sname = Trim(a_str1) + Trim(b_str1) + ".xls"

ActiveWorkbook.SaveAs Filename:=sname, _
FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False

---
Message posted from http://www.ExcelForum.com/


--

Dave Peterson

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro - File Save As

Tx Dave. It worked fine. I got that macro off an old post somewher
here

--
Message posted from http://www.ExcelForum.com

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
2007 Macro to Open File, Delete Contents, Save New File Flintstone[_2_] Excel Discussion (Misc queries) 2 February 1st 10 11:25 PM
Macro Save File (Unique file name) SJC Excel Worksheet Functions 5 October 27th 05 10:09 PM
Macro to insert values from a file and save another sheet as a .txt file Frank[_16_] Excel Programming 2 August 28th 03 01:07 AM
Automate open file, update links, run macro, close and save file Geoff[_7_] Excel Programming 2 August 26th 03 10:13 PM
HOw do you save a file using a macro? kelleygirl Excel Programming 3 August 21st 03 09:31 PM


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