locked
Macro Not Found error? RRS feed

  • Question

  • When I run the following code in my Excel 2003 workbook, it tells me that macros RefreshQueries and SaveAndClose cannot be found, but they're within the same workbook??

    Any help appreciated.  


    1 Public Refreshed  
    2 Private Sub RefreshQueries()  
    3     ActiveWorkbook.RefreshAll  
    4     Refreshed = True 
    5 End Sub 
    6 Private Sub SaveAndConfirm()  
    7     thisMonth = Month(Now())  
    8     thisYear = Year(Now())  
    9     If Refreshed = True Then 
    10         ActiveWorkbook.Save  
    11         ActiveWorksheet.SendMail "me@somewhere.com""Dental Incentive Gift Cards - " & thisMonth & " " & thisYear, "false" 
    12     Else 
    13         ActiveWorksheet.SendMail "me@somewhere.com""Dental Incentive Gift Cards - " & thisMonth & " " & thisYear & " failed to refresh""false" 
    14     End If 
    15     ActiveWorkbook.Close  
    16 End Sub 
    17 Private Sub Workbook_Open()  
    18     Refreshed = False 
    19     Application.OnTime Now + TimeValue("00:00:10"), "RefreshQueries()" 
    20     Application.OnTime Now + TimeValue("00:01:00"), "SaveAndConfirm()" 
    21 End Sub 
    22  
    • Moved by Riquel_Dong Monday, June 9, 2008 6:16 AM VBA issue
    Wednesday, June 4, 2008 1:46 PM

Answers

  • Hi Jcrawf02,

    It is the best option to post the VBA issues to the VBA forum for the appropriate answers.

    Best regards,
    Riquel

    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Friday, June 6, 2008 6:00 AM