PC Review


Reply
Thread Tools Rate Thread

Compiler Error

 
 
Chad
Guest
Posts: n/a
 
      7th Dec 2008
Hi All,

I was writing the following code. I copied a chunk of code into the
FilterABAAssays() sub and when I went to compile it, I got the following
error

Compile error:
Only comments may appear after End Sub, End Function, or End Property

I looked everywhere to find anything after my sub ends, but cannot see
anything

Code:

Option Explicit

Sub Main()
Call Getdata
Call Assays.LoadAssays
Call FilterABAAssays
End Sub

Sub Getdata()
fABA.Show
End Sub

Sub FilterABAAssays()
Dim NewBook As Workbook
Selection.AutoFilter
Selection.AutoFilter Field:=2, Criteria1:=ABAPit
Selection.AutoFilter Field:=3, Criteria1:=ABABench
Worksheets("Sheet1").UsedRange.Copy
Set NewBook = Workbooks.Add
NewBook.Worksheets("Sheet1").Range("A1").PasteSpecial Paste:=xlValues
End Sub



 
Reply With Quote
 
 
 
 
Barb Reinhardt
Guest
Posts: n/a
 
      7th Dec 2008
It looks like you've got some forms and other subs you're calling. Take a
look at the line it highlighted for a clue when you compile it.
--
HTH,
Barb Reinhardt

If this post was helpful to you, please click YES below.



"Chad" wrote:

> Hi All,
>
> I was writing the following code. I copied a chunk of code into the
> FilterABAAssays() sub and when I went to compile it, I got the following
> error
>
> Compile error:
> Only comments may appear after End Sub, End Function, or End Property
>
> I looked everywhere to find anything after my sub ends, but cannot see
> anything
>
> Code:
>
> Option Explicit
>
> Sub Main()
> Call Getdata
> Call Assays.LoadAssays
> Call FilterABAAssays
> End Sub
>
> Sub Getdata()
> fABA.Show
> End Sub
>
> Sub FilterABAAssays()
> Dim NewBook As Workbook
> Selection.AutoFilter
> Selection.AutoFilter Field:=2, Criteria1:=ABAPit
> Selection.AutoFilter Field:=3, Criteria1:=ABABench
> Worksheets("Sheet1").UsedRange.Copy
> Set NewBook = Workbooks.Add
> NewBook.Worksheets("Sheet1").Range("A1").PasteSpecial Paste:=xlValues
> End Sub
>
>
>
>

 
Reply With Quote
 
Chad
Guest
Posts: n/a
 
      7th Dec 2008
It was wierd. If I rearranged my subs, it always highlighted the last line
of the last sub. I deleted it all and retyped it, and it did the same
thing. The first sub would work, and the next failed.

After numerous attempts, the editor crashed. After killing the process and
reopening everything, it worked fine.

Should have tried closing everything down before asking for help.

Thanks
Chad

"Barb Reinhardt" <(E-Mail Removed)> wrote in message
news:C54AC687-3D6E-491D-A550-(E-Mail Removed)...
> It looks like you've got some forms and other subs you're calling. Take
> a
> look at the line it highlighted for a clue when you compile it.
> --
> HTH,
> Barb Reinhardt
>
> If this post was helpful to you, please click YES below.
>
>
>
> "Chad" wrote:
>
>> Hi All,
>>
>> I was writing the following code. I copied a chunk of code into the
>> FilterABAAssays() sub and when I went to compile it, I got the following
>> error
>>
>> Compile error:
>> Only comments may appear after End Sub, End Function, or End Property
>>
>> I looked everywhere to find anything after my sub ends, but cannot see
>> anything
>>
>> Code:
>>
>> Option Explicit
>>
>> Sub Main()
>> Call Getdata
>> Call Assays.LoadAssays
>> Call FilterABAAssays
>> End Sub
>>
>> Sub Getdata()
>> fABA.Show
>> End Sub
>>
>> Sub FilterABAAssays()
>> Dim NewBook As Workbook
>> Selection.AutoFilter
>> Selection.AutoFilter Field:=2, Criteria1:=ABAPit
>> Selection.AutoFilter Field:=3, Criteria1:=ABABench
>> Worksheets("Sheet1").UsedRange.Copy
>> Set NewBook = Workbooks.Add
>> NewBook.Worksheets("Sheet1").Range("A1").PasteSpecial Paste:=xlValues
>> End Sub
>>
>>
>>
>>



 
Reply With Quote
 
JLGWhiz
Guest
Posts: n/a
 
      7th Dec 2008
Sometimes when I do a lot of revisions, I keep moving my code range downward.
The bottom of the range can be several linefeeds below what appears to be
the last line of code. If I did not happen to get the whole block of code
for a previous deletion, it could leave an entry several lines below where I
can see. The scroll bar slide tab is the give-away in a case like that, If
there is a big gap between the slide tab and the down arrow, I take ithe
slide tab all the way to the bottom to be sure I don't leave any dribbles.






"Chad" wrote:

> It was wierd. If I rearranged my subs, it always highlighted the last line
> of the last sub. I deleted it all and retyped it, and it did the same
> thing. The first sub would work, and the next failed.
>
> After numerous attempts, the editor crashed. After killing the process and
> reopening everything, it worked fine.
>
> Should have tried closing everything down before asking for help.
>
> Thanks
> Chad
>
> "Barb Reinhardt" <(E-Mail Removed)> wrote in message
> news:C54AC687-3D6E-491D-A550-(E-Mail Removed)...
> > It looks like you've got some forms and other subs you're calling. Take
> > a
> > look at the line it highlighted for a clue when you compile it.
> > --
> > HTH,
> > Barb Reinhardt
> >
> > If this post was helpful to you, please click YES below.
> >
> >
> >
> > "Chad" wrote:
> >
> >> Hi All,
> >>
> >> I was writing the following code. I copied a chunk of code into the
> >> FilterABAAssays() sub and when I went to compile it, I got the following
> >> error
> >>
> >> Compile error:
> >> Only comments may appear after End Sub, End Function, or End Property
> >>
> >> I looked everywhere to find anything after my sub ends, but cannot see
> >> anything
> >>
> >> Code:
> >>
> >> Option Explicit
> >>
> >> Sub Main()
> >> Call Getdata
> >> Call Assays.LoadAssays
> >> Call FilterABAAssays
> >> End Sub
> >>
> >> Sub Getdata()
> >> fABA.Show
> >> End Sub
> >>
> >> Sub FilterABAAssays()
> >> Dim NewBook As Workbook
> >> Selection.AutoFilter
> >> Selection.AutoFilter Field:=2, Criteria1:=ABAPit
> >> Selection.AutoFilter Field:=3, Criteria1:=ABABench
> >> Worksheets("Sheet1").UsedRange.Copy
> >> Set NewBook = Workbooks.Add
> >> NewBook.Worksheets("Sheet1").Range("A1").PasteSpecial Paste:=xlValues
> >> End Sub
> >>
> >>
> >>
> >>

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Possible VS2003 c# compiler bug: error CS0584: Internal Compiler Error: stage 'COMPILE' symbol '' eblanco Microsoft Dot NET Framework 0 28th Jul 2006 09:40 PM
Compiler Error Message: The compiler failed with error code -1073741819 Ram Microsoft ASP .NET 0 13th Sep 2005 10:52 AM
fatal error C1001: INTERNAL COMPILER ERROR (compiler file 'f:\vs70builds\3077\vc\Compiler\Utc\src\P2\main.c', line 148) PufferFish Microsoft VC .NET 10 6th Aug 2004 10:33 PM
fatal error C1001: INTERNAL COMPILER ERROR (compiler file 'msc1.cpp', line 2701) =?Utf-8?B?TWFyY28gTm92YQ==?= Microsoft VC .NET 9 27th Apr 2004 06:55 PM
Compiler Error Message: The compiler failed with error code 128. Yan Microsoft ASP .NET 0 21st Jul 2003 11:49 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:01 PM.