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

I have the following code and it doesn't save as it is supposed to. Am I
missing something? I can't seem to figure it out. Thanks.

Sub Upload()
Application.EnableCancelKey = xlDisabled
Sheets("Upload").Select

lastRow = Range("M10000").End(xlUp).Row

Range("M" & lastRow).Offset(1, 0).Select
ActiveCell.FormulaR1C1 = "END"


Call Copy_GL


Q = Range("n1")


Call VoucherNum





Range("a1:n1000").Select
Selection.Copy
Workbooks.Add
ActiveSheet.Paste

'Application.Goto referenece:="gl_acct"
'ActiveCell.Offset(0, 1).Range("a1").Select
'ActiveCell.ClearContents
Rows("1:1").Select
Selection.Delete Shift:=xlUp

spath = "P:\Platinum\A_P IMPORT\Contractor Invoices\" & Q

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


ActiveWindow.Close
'windows("xxxxxxx").activate
Range("a3:m1000").ClearContents
Call name_fields









End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Macro to save a workbook

you mustn't use square brackets for declare Filename, that is

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

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
Macro save workbook puiuluipui Excel Discussion (Misc queries) 3 November 13th 09 04:40 PM
Do not save macro with workbook Jeff Excel Programming 2 April 30th 09 04:40 PM
Save workbook not macro [email protected] Excel Programming 1 August 3rd 07 03:29 PM
possible to save macro with workbook as add-in? John Smith Excel Programming 3 November 29th 06 05:35 PM
"Save" macro problem, still prompted to save when closing workbook (?) StargateFanFromWork[_4_] Excel Programming 8 September 13th 06 04:49 PM


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