+ Reply to Thread
Results 1 to 9 of 9

Excel macro acting differently on two machines

  1. #1
    Registered User
    Join Date
    12-21-2006
    Posts
    27

    Unhappy Excel macro acting differently on two machines

    Hi guys this is my first post to this forum....really hope someone can be of help!

    I have written a fairly complicated macro to summarise loads of data etc. On my laptop it works as it should. On the actual live system, on most computers it works as it should, except for one computer. And it is that one computer that uses it most, typical eh?

    Basically it has a load of data dumped into it from Access. The macro then subtotals it at various points, when say the country changes, and then finishes up by just displaying the subtotals.

    On the computer that isn't working, it just stops half way through, I think it stops when there is just 1 country to subtotal. I created a file from Access and ran it on my laptop and another computer on the network and it runs fine, I run the same file on this computer and it just fails to complete...with no error messages.

    I am convinced that it is something to do with Excel on her machine, I have checked the references and they are the same throughout, she is on the same version as Excel as me (2003), the other computer it runs on is on 2000.

    If anyone has any clue at all I would love to hear from you!

    Thanks for reading my long post!

  2. #2
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    Without seeing the code it is very hard to know if it is a code or excel problem

    From my experience it is usually a problem in the code and not Excel that causes the problem.

    Are you using any code the says On error goto or Resume next?
    or any Exit sub or End commands

    You may need to add code to track which part of the code it is processing when is stops running

    Debug.Print command can help

  3. #3
    Registered User
    Join Date
    12-21-2006
    Posts
    27
    Hey thanks for the reply.

    No I do not use error codes, I never really learnt how to use them. It is a lot of code and I didnt fancy scrolling through it all until I can be sure it is the code that is incorrect. I do not understand how it could possibly be the code though, when the code is acting fine on most machines, but then there is just 1 where it fails to work.

    I was more thinking it was to do with some settings on the machine, but I really dont know what possible settings I could change.

    Anyway attached is the template for the report with the code in it. If I sent you any data I would get shot, so unless you really need some in which case Ill make some up, then its attached.

    Thanks again,
    Michael.
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    12-21-2006
    Posts
    27
    To those of you who are interested in my stupid error, I have solved it

    Basically for some bizarre reason, Microsoft have slightly altered the way Subtotalling works I think. What was happening originally is that I wanted to subtotal on each change in product type, but also when the country changed I wanted it to put a subtotal there. To do that I went through before subtotalling and put a blank row in when there was a change of country. This fixed it perfectly on my copy of Excel.

    However, on other machines, it seemed to disregard the blank row completely and compare it to the next row, sometimes it would find a match and just completely ignore the blank row and basically mess up the whole thing.

    The main thing Im trying to say is on my version is includes blank cells, on others it excludes blank cells.

    To fix it as well as adding a blank line, I just put a 1 in each cell, as the line gets deleted afterwards anyway. Bloody annoying I tell you.

    Michael.

  5. #5
    Registered User
    Join Date
    06-04-2007
    Posts
    4

    Question Macro works in 2003 but not in 2000

    I have a similar problem.
    I have a problem that occurs with MS Excel 2003 Professional but not MS Excel 2000 Professional. I am on Windows XP.

    The Macro runs without an error message, but instead of completing, it seems to be stuck in a loop where it keeps forcing blank lines to print.
    The piece of code causing the problem is below:

    Set myRange = ActiveSheet.UsedRange
    For Each rw In myRange.Rows

    If insertNextRow Then
    Rows(rw.Row).Select
    Selection.Insert Shift:=xlDown
    End If

    insertNextRow = False
    If rw.OutlineLevel = 3 Then
    insertNextRow = True
    End If

    Next rw

    This part of the macro inserts a row between subtotalled groups only. This works in Excel 2000 but in Excel 2003 it will keep inserting lines forever unless you break out of the macro.

    Does anyone know how to fix this? Thanks in advance.

  6. #6
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    bucklsu

    Please read forum rules see blue link below

    Closing thread
    Please Read Forum Rules Before Posting
    Wrap VBA code by selecting the code and clicking the # icon or Read This
    How To Cross Post politely

    Top Excel links for beginners to Experts

    If you are pleased with a member's answer then use the Scales icon to rate it
    If my reply has assisted or failed to assist you I welcome your Feedback.

  7. #7
    Registered User
    Join Date
    06-04-2007
    Posts
    4

    Excel Macro acting differently on two machines

    I don't understand what you mean by wrapping it using the "#" symbol. I reviewed your rules, and I honestly don't see how to do this, or what it does. Please provide a better explanation.
    Thanks.

  8. #8
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    To wrap your VBA code instructions

    You type your message in the Message window
    Above the are you type your message in are a group of icons that you can use to assist in formatting your message. When adding VBA to the message use the # symbol, This will give you the word code twice surrounded by [ ] brackets & the cusor will appear between the ][ brackets - this is were the VBA goes

    Or you can place the code in the message, select the code then click on the # Icon

    You will not see the message formatted correctly until you post it or click on the Preview post button

    Please Login or Register  to view this content.
    Last edited by mudraker; 10-22-2007 at 05:59 PM.

  9. #9
    Registered User
    Join Date
    06-04-2007
    Posts
    4

    Question Excel Macro won't work in 2003 but works in 2000

    have a similar problem.
    I have a problem that occurs with MS Excel 2003 Professional but not MS Excel 2000 Professional. I am on Windows XP.

    The Macro runs without an error message, but instead of completing, it seems to be stuck in a loop where it keeps forcing blank lines to print.
    The piece of code causing the problem is below:

    Please Login or Register  to view this content.
    This part of the macro inserts a row between subtotalled groups only. This works in Excel 2000 but in Excel 2003 it will keep inserting lines forever unless you break out of the macro.

    Does anyone know how to fix this? Thanks in advance.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1