Cannot save 2003 file in 2010

techstyle20

New Member
Joined
May 14, 2012
Messages
40
Hi,

I am hoping someone can help. I have a macro that saves a file prefectly in 2003 but the same macro does not work in 2010. In my office we have users who are on both 2010 and 2003 so i need this to work on each version.

In essence I want this macro to save a new workbook as .xls so that all users can view and use the workbook. I have scoured this looking for an answer but nothing seems to work.

Can anyone help?

Sub CreateWorkbooks()
'creates new workbook in a specific location
Application.ScreenUpdating = False
Dim FilePath As String
Dim FName As String
Dim TodaysDate
TodaysDate = Format(Date, "dd-mm-yyyy")
FName = Range("P8").Value
Workbooks.Add
FilePath = "Child"
ActiveWorkbook.SaveAs FileName:=FilePath & "\" & FName & "" & TodaysDate & ".xls"

ActiveWorkbook.Close

End Sub
 
I suppose desktop paths are off topic as far as the OP is concerned, but this works in both XP and Win7:
Code:
fPath = CreateObject("WScript.Shell").SpecialFolders("Desktop")
[COLOR="Navy"]Debug[/COLOR].[COLOR="Navy"]Print[/COLOR] fPath [COLOR="SeaGreen"]'//your desktop folder path, without a trailing slash[/COLOR]

myDocuments instead of Desktop is another useful one
 
Upvote 0

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.

Forum statistics

Threads
1,223,244
Messages
6,170,976
Members
452,372
Latest member
Natalie18

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