Hi
We are trying to run a macro (with dialogsheets and edit box) that was created sometime pre '97 in our 2003 version of excel.
at the end of the module ('97 version) there is the following code that uses
If OldDate <> NewDate Then
Range("E2") = Range("E2").Value + 1
Dim ck As Boolean
If newName = "" Then
str1 = "Enter New File Name Here"
Else
str1 = newName
End If
ck = Application.Dialogs(xlDialogSaveAs).Show(str1)
If ck = True Then
newName = ActiveWorkbook.Name
ActiveWorkbook.Close
End If
Endif
The intent is to save the exisiting workbook with a new name only if the date information stored in "E2" cell is updated to a value in next year (eg. Jan 1, 2012). The macro runs fine until this happen.
The macros in new saved file does not run. I get subscript out of range Error 9. On debugging the code seems to stop at the following line:
DialogSheets("Cell").EditBoxes("103").Text = "Anode to Cell Cover Voltage"
How do i fix this error?
Did the dialogsheet and the edit boxes get copied accurately when I saving through the code? I could save the files manually but wondering why the macro doesnt work.
Is this because the original file is a 97 version? If so what is the way around?
I am a new programmer so kindly bear with me if I haven't been clear with this posted questions.
Much appreciate any guidance.
Shigem
P.S. I code post the entire macro code if required. it is very long though
We are trying to run a macro (with dialogsheets and edit box) that was created sometime pre '97 in our 2003 version of excel.
at the end of the module ('97 version) there is the following code that uses
If OldDate <> NewDate Then
Range("E2") = Range("E2").Value + 1
Dim ck As Boolean
If newName = "" Then
str1 = "Enter New File Name Here"
Else
str1 = newName
End If
ck = Application.Dialogs(xlDialogSaveAs).Show(str1)
If ck = True Then
newName = ActiveWorkbook.Name
ActiveWorkbook.Close
End If
Endif
The intent is to save the exisiting workbook with a new name only if the date information stored in "E2" cell is updated to a value in next year (eg. Jan 1, 2012). The macro runs fine until this happen.
The macros in new saved file does not run. I get subscript out of range Error 9. On debugging the code seems to stop at the following line:
DialogSheets("Cell").EditBoxes("103").Text = "Anode to Cell Cover Voltage"
How do i fix this error?
Did the dialogsheet and the edit boxes get copied accurately when I saving through the code? I could save the files manually but wondering why the macro doesnt work.
Is this because the original file is a 97 version? If so what is the way around?
I am a new programmer so kindly bear with me if I haven't been clear with this posted questions.
Much appreciate any guidance.
Shigem
P.S. I code post the entire macro code if required. it is very long though