Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trying to use SaveAs in VBA but not working, please help. 1

Status
Not open for further replies.

vamoose

Programmer
Oct 16, 2005
320
MX
Can someone please tell me why this does not work. What is does is clear the value in sheet1, cell B7 and then saves it as C:\Winding\.xls
The value in sheet1, cell B7 is a string value. Excel 2000.

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Sheet1.Range("B7").Value = X
Application.DisplayAlerts = True
SaveAs "C:\Winding\" & X & ".xls"
End Sub

Thanks so much.
 
You're in a ms access forum.



But you could checkout "option explicit" with help (F1),
Your declaration of variables is not proper.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top