Save copy without VB

bposaner

Board Regular
Joined
May 28, 2002
Messages
74
Guys

I'm sure its a simple answer but I've tried a search and found nothing suitable
I basically want to save a copy of a workbook, but without any of the VB, etc. Thats it.

I cant use XML, as one sheet is a graph.

I have been using the below bit, but i need it as 2003 format not as a xlsx
Code:
ActiveWorkbook.SaveAs Filename:=strFile, FileFormat:=51, CreateBackup:=False

Any help would be great.
Thanks
bposaner
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
Thanks for the responce, but i'm now getting a runtime error 1004
Method "SaveAs' of object '_Workbook' failed

Any ideas why? Also where can i find a list of the "FileFormat:=??"
Thanks

My full code is now:
Code:
Sub SaveIt()
    
Dim strPeriod As String
Dim strFile As String

    Sheets("Data").Select
    strPeriod = Sheets("Data").ListBox1.Text
    strPeriod = Left(strPeriod, 2) & Mid(strPeriod, 4, 3) & Mid(strPeriod, 8, 2)
    strFile = "D:\Data\" & strPeriod
    ActiveWorkbook.SaveAs Filename:=strFile, FileFormat:=56, CreateBackup:=False
    
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,798
Messages
6,121,636
Members
449,043
Latest member
farhansadik

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top