Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 396
Default Help with Problem code needed

Hi, i have the code below that i have a problem with.

When i run it manually it works fine but always stops with "Code
execution has been interrupted" after loading the required file... Ther
are no breakpoints and it worked fine before ??

Sub testfileExists()
'
'
'Application.IgnoreRemoteRequests = True

If Dir("C:\gAMS_ZA-T-M\Reports\Downloads\Weekly_Report.xls") = "" Then
MsgBox "Sorry the file ""Weekly_Report.xls"" is not in the folder !!"
& vbCrLf & _
"" & vbCrLf & _
"Please generate a new report and save it to:-" & vbCrLf & _
"""C:\gAMS_ZA-T-M\Reports\Downloads\"" as
""Weekly_Report.xls""" & vbCrLf & _
"Then re-open this macro.", vbOKOnly + vbInformation, "Oops no
file !!"
Else
If (Now() -
filedatetime("C:\gAMS_ZA-T-M\Reports\Downloads\Weekly_Report.xls")) 7
Then
MsgBox "The file you are going to process" & vbCrLf & _
"was created longer than 7 days ago !!" & vbCrLf & _
"& cannot be used ?", vbExclamation + vbOKOnly, "Warning
Old File"
chkWkbToClose
Else
ChDir "C:\gAMS_ZA-T-M\Reports\Downloads"
Workbooks.Open
Filename:="C:\gAMS_ZA-T-M\Reports\Downloads\Weekly_Report.xls"
RemoveRows'******** AT THIS POINT - ERROR *******
End If
End If
End Sub

'************ Format the header row *****************
Sub RemoveRows()


Les Stout

*** Sent via Developersdex http://www.developersdex.com ***
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,117
Default Help with Problem code needed

ChDir "C:\gAMS_ZA-T-M\Reports\Downloads"
Workbooks.Open
Filename:="C:\gAMS_ZA-T-M\Reports\Downloads\Weekly_Report.xls"
RemoveRows'******** AT THIS POINT - ERROR *******


i'm no expert but when i insert another sub to run within one, i have
to use

Call RemoveRows

but maybe somebody else will find something different.
susan

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Help with Problem code needed

Hi Susan, thanks for the reply, i tried that too but with no success
though.


Susan wrote:
ChDir "C:\gAMS_ZA-T-M\Reports\Downloads"
Workbooks.Open
Filename:="C:\gAMS_ZA-T-M\Reports\Downloads\Weekly_Report.xls"
RemoveRows'******** AT THIS POINT - ERROR *******


i'm no expert but when i insert another sub to run within one, i have
to use

Call RemoveRows

but maybe somebody else will find something different.
susan


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA code help needed Martin Excel Discussion (Misc queries) 3 April 28th 06 09:28 AM
Code Help Needed Michael168[_116_] Excel Programming 2 September 18th 04 05:28 PM
VB Code needed for Sorting with constraints problem-Tough One Leroy Excel Programming 0 April 30th 04 02:16 PM
VBA code Help needed liamothelegend Excel Programming 1 November 5th 03 12:25 PM
code needed ibo Excel Programming 0 July 29th 03 05:32 PM


All times are GMT +1. The time now is 02:41 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"