Macro Issue

T

TimWal

Hey guys,

I am having an issue with a macro from Excel 2002 in Excel 2003. Under
2002 it works just fine, but errors out in 2003.

Can anyone tell what is wrong with it, any help would be greatly
appreciated -

Sub Save_to_History()

Dim BackupFileName As String

BackupFileName = Range("openfile")

If MsgBox("Are you sure you want to save to history?", vbYesNo +
vbCritical, "WARNING!") = vbYes Then

ActiveWorkbook.Save
ActiveWorkbook.SaveCopyAs ("C:\data\forms\history\" & Range("o3"))

End If


End Sub
 
J

Jim Cone

What is the error and at what line does it occur?
Possibilities...

Splitting a line in a msgbox at the "+" sign can result in Excel
dropping the "+".

Since you have a new version of Excel, does that mean you are
using a different computer? If so the file path may not exist.

Is there already an existing file with the name you are trying to use?

Is there a named range called "openfile". How is it used in the sub?
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware


"TimWal" <[email protected]>
wrote in message
Hey guys,
I am having an issue with a macro from Excel 2002 in Excel 2003. Under
2002 it works just fine, but errors out in 2003.
Can anyone tell what is wrong with it, any help would be greatly
appreciated -

Sub Save_to_History()

Dim BackupFileName As String

BackupFileName = Range("openfile")

If MsgBox("Are you sure you want to save to history?", vbYesNo +
vbCritical, "WARNING!") = vbYes Then
ActiveWorkbook.Save
ActiveWorkbook.SaveCopyAs ("C:\data\forms\history\" & Range("o3"))
End If
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top