Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Program too large

I am having a problem with a macro that I am writing. Everytime I try
to run it it gives me an error. I think I can fix it using global
variables. But now I keep getting an error saying invalid attribute. I
have tried setting all variables = 0 then running it. Please help!!!!

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Program too large

Give us more details on the error and when it happens.
AFAIK, there is limit of 64K (?) for the amount of code contained in a
single module, although I see no reason to ever get that large. Split it
into routines (sub/function) in modules/classes.
How large is your code ? Right-click on the moduleExport, save somewhere
suitable and check the size of the resultant file.

NickHK

wrote in message
ups.com...
I am having a problem with a macro that I am writing. Everytime I try
to run it it gives me an error. I think I can fix it using global
variables. But now I keep getting an error saying invalid attribute. I
have tried setting all variables = 0 then running it. Please help!!!!



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 694
Default Program too large

You can try debugging your code and setting thru the program.

Some simple solutions are to use option explicit to check al lthe variables
are spelt correctly.

Generally attributes refer to incorrect items in function or procedure calls.

Check the line where your code breaks down and make sure the code is correct.

Do this with clicking debug and see where you are.


--
Hope this helps
Martin Fishlock
Please do not forget to rate this reply.


" wrote:

I am having a problem with a macro that I am writing. Everytime I try
to run it it gives me an error. I think I can fix it using global
variables. But now I keep getting an error saying invalid attribute. I
have tried setting all variables = 0 then running it. Please help!!!!


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Program too large

And the error is where ?
As a text file, it is ~56K, all in one routine, but it looks like you need
to look at using arrays and process in a loop, then you would have a much
shorter routine.

Dim xData(1 to 36?) as long
'Then assign values

for i=1 to 36
....etc

NickHK

wrote in message
ups.com...
here is my code. I hope it isn't too large for this post.

Sub sort_WC()
Dim wscost As Worksheet
Dim wscostsort As Worksheet

Dim x As Long
Dim lrow1 As Long
Dim cnt As Long
Dim xjan04 As Long
Dim xfeb04 As Long
Dim xmar04 As Long
Dim xapr04 As Long
Dim xmay04 As Long
Dim xjun04 As Long
Dim xjul04 As Long
Dim xaug04 As Long

----------- CUT --------------


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Program too large


I am getting the error when I run the macro. It says that the macro is
too large. The reason I am I am using so many variables is because I
want to keep the references to the lines after each sort so I can
create a graph on a new sheet. I don't know much about arrays but I
could try it if it will give me the same result.

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
Add-In Program NoodNutt Excel Worksheet Functions 1 August 30th 08 06:59 AM
Is there a way to unload the loaded XLL file in Excel? Hi all, I amdebugging XLL link library using Visual C++. Everytime I rebuild the XLL, Ihave to close the whole Excel program and relaunch the Excel program again,and then load in the newly gene LunaMoon Excel Discussion (Misc queries) 0 July 28th 08 11:03 PM
sum program enyaw Excel Programming 1 June 6th 06 12:57 PM
My Program SM Charts and Charting in Excel 1 October 21st 05 09:48 PM
merging excel program with tdc finance program judy Excel Programming 0 November 5th 03 08:01 PM


All times are GMT +1. The time now is 06:41 PM.

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"