+ Reply to Thread
Results 1 to 11 of 11

Last Sub not working when called

  1. #1
    Registered User
    Join Date
    07-04-2015
    Location
    Newcastle, Australia
    MS-Off Ver
    2013
    Posts
    12

    Last Sub not working when called

    delettesd.....
    Last edited by BGUNN; 07-10-2015 at 03:16 AM. Reason: code tags

  2. #2
    Forum Contributor
    Join Date
    04-20-2015
    Location
    Switzerland
    MS-Off Ver
    2010
    Posts
    312

    Re: Last Sub not working when called

    Hi Bgunn,

    first you should put that code in Code tags.
    I was generating a fake data Sheet as first sheet in the Workbook and the files where created
    what i recognized is that the Data sheet was still empty i guess thats cause you always just use range(xy) instead of sth like WS.range where ws is the Worksheet you want the stuff to be done/taken from

    If you post the workbook i can provide more help

  3. #3
    Registered User
    Join Date
    07-04-2015
    Location
    Newcastle, Australia
    MS-Off Ver
    2013
    Posts
    12

    Re: Last Sub not working when called

    Hi LordLoki,

    Thanks very much for your reply. Code tags done.

    I think I have managed to incorporate your suggestion regarding the range.
    I have also uploaded the current version of my workbook to take up your offer of more help.

    Regards
    BGUNN

  4. #4
    Registered User
    Join Date
    07-04-2015
    Location
    Newcastle, Australia
    MS-Off Ver
    2013
    Posts
    12

    Re: Last Sub not working when called

    File Attached
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    04-20-2015
    Location
    Switzerland
    MS-Off Ver
    2010
    Posts
    312

    Re: Last Sub not working when called

    will check that tomorrow its to late for me today

  6. #6
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Last Sub not working when called

    BGUNN

    Which sub should be run first?

    Also, why all the On Error... stuff? That justs hides errors.
    If posting code please use code tags, see here.

  7. #7
    Registered User
    Join Date
    07-04-2015
    Location
    Newcastle, Australia
    MS-Off Ver
    2013
    Posts
    12
    Quote Originally Posted by Norie View Post
    BGUNN

    Which sub should be run first?

    Also, why all the On Error... stuff? That justs hides errors.
    Hi Norie,
    A_Findsheet runs first. On error was just in the syntax I leveraged. Does not seem to cause any issues. Feel free to make recommendations.
    Thanks

  8. #8
    Forum Contributor
    Join Date
    04-20-2015
    Location
    Switzerland
    MS-Off Ver
    2010
    Posts
    312

    Re: Last Sub not working when called

    Hi BGunn,

    I think there is some kind of logical error inside your Worksheet but maybe i miss something.
    All your subs are running perfectly fine you just seem to grab the wrong sheets
    Can you explain what the Whole thing with the Temp Sheet and Copy is supposed to do?
    Cause for me it looks like you don't need to do that in order to get your XML Files.

    Check the Sheet attached and you see that you get xml files with the Data from the iTreAD_Notifications Sheet
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    07-04-2015
    Location
    Newcastle, Australia
    MS-Off Ver
    2013
    Posts
    12

    Re: Last Sub not working when called

    Thanks LordLoki
    You're right, I'm grabbing the wrong sheet.
    I have not checked your workbook yet but I had success when I changed in the E_XLStoXML sub

    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.
    I think (1) refers to the first worksheet not necessarily Sheet 1

    I'll check out your sheet too when I can. Late for me here

    The workbook is not quite finished yet but the Temp sheet is used to copy and flatten out data from the Query Task Manager sheet. The Notifications sheet references Temp to build up a list of "notifications" per row. The rows are generated to an xml format which is able to be processed by an external application which can then relay to a communications service provider. I'm turning raw data to Emails and SMS.

    Last edited by BGUNN; 07-09-2015 at 08:08 AM.

  10. #10
    Forum Contributor
    Join Date
    04-20-2015
    Location
    Switzerland
    MS-Off Ver
    2010
    Posts
    312

    Re: Last Sub not working when called

    Ah then you came to the same conclusion then me.
    I changed it to
    Please Login or Register  to view this content.
    that does the same to use the Sheet name is even better cause you don't get an error when someone messes with the Sheet order.

    Looks like a nice project if you have any Questions or problems just give a shout

  11. #11
    Registered User
    Join Date
    07-04-2015
    Location
    Newcastle, Australia
    MS-Off Ver
    2013
    Posts
    12

    Re: Last Sub not working when called

    Great minds think alike!
    A second pair of eyes always helps.

    I'll be sure to let you know if I have any further questions.

    Thanks for taking the time.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. FreesePanes not working if XMTL is called from VBS
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-20-2014, 02:47 PM
  2. Add-In not working when Excel called from command line
    By tweaver60 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 01-31-2012, 12:01 PM
  3. Application.WorksheetFunction stops working if the Sub is called
    By emmalg in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 02-03-2011, 09:28 AM
  4. UDF working when called from Sub, doesn't work as worksheet function
    By stevenf in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-28-2009, 07:32 PM
  5. Private sub not working correctly when called from another macro
    By Zyphon in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-05-2008, 08:16 PM

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