+ Reply to Thread
Results 1 to 10 of 10

Macro not working correctly, what did I do wrong?

  1. #1
    Registered User
    Join Date
    03-08-2010
    Location
    Sweden
    MS-Off Ver
    MS Office 365 Mac and Windows
    Posts
    94

    Macro not working correctly, what did I do wrong?

    This is the code I am using, the problem is that it does not process the file it gives me "Complete 0 files where processed" It seems not calling the other function, but when I change its the name it ask for it and when I change the path for the files it gives me "could not find the path". When only running the "call subfunction" it works fine but together with Sub "OpenConvertSave" it does nothing... something I am missing

    Sorry for the trouble...

    Please Login or Register  to view this content.
    Last edited by soreno; 03-12-2010 at 03:32 PM.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Macro not working correctly, what did I do wrong?

    The code looks fine, you created a folder on the D:\ drive called 2010 and put your CSV file in there?

    You can go the OPENCONVERTSAVE macro in the VBEditor and press F8 to step through the code one line at a time, switching back and forth between the editor and the workbook to see what occurs, hovering your mouse over key variables after they become initiated to see what the current value is...

    As you F8 through the code, does a CSV from your folder get opened?
    Does your JusteraRutter macro begin and let you step through that?
    Where does it fail to do what you expect as you step through?
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    03-08-2010
    Location
    Sweden
    MS-Off Ver
    MS Office 365 Mac and Windows
    Posts
    94

    Re: Macro not working correctly, what did I do wrong?

    Quote Originally Posted by JBeaucaire View Post
    The code looks fine, you created a folder on the D:\ drive called 2010 and put your CSV file in there?

    Yes!

    You can go the OPENCONVERTSAVE macro in the VBEditor and press F8 to step through the code one line at a time, switching back and forth between the editor and the workbook to see what occurs, hovering your mouse over key variables after they become initiated to see what the current value is...

    As you F8 through the code, does a CSV from your folder get opened?
    Does your JusteraRutter macro begin and let you step through that?
    Where does it fail to do what you expect as you step through?
    This puzzels me, when going thru the steps in the code, it yellows it all the way down to
    Please Login or Register  to view this content.
    Then it jumps down to
    Please Login or Register  to view this content.
    and nothing happens!!... except I can read the MsgBox

    Strange....

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Macro not working correctly, what did I do wrong?

    Sure, that means there is nothing in the fName variable.

    That means your macro looked in "D:\2010\" and found no csv files in there. Check your spelling of the folder name, Excel can't find a CSV file in the folder you've specified.

  5. #5
    Registered User
    Join Date
    03-08-2010
    Location
    Sweden
    MS-Off Ver
    MS Office 365 Mac and Windows
    Posts
    94

    Re: Macro not working correctly, what did I do wrong?

    Quote Originally Posted by JBeaucaire View Post
    Sure, that means there is nothing in the fName variable.

    That means your macro looked in "D:\2010\" and found no csv files in there. Check your spelling of the folder name, Excel can't find a CSV file in the folder you've specified.
    Could the problem be with the letters "å, ä, ö" in the filename?
    I dont see anything wrong with the paths or csv files see attached printscreen...

    Thanks

    Change the filename from "ö" to "o" but that did not help so that is not the problem...
    Attached Images Attached Images
    Last edited by soreno; 03-12-2010 at 01:40 PM.

  6. #6
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Macro not working correctly, what did I do wrong?

    I don't know. I tried the macro on my C:\2010\ folder and it works, your system is not resolving the path properly it appears.

    Note: the code to make the \Imported folder inside the CSV file folder occurs BEFORE the line of code that is failing, but I don't see the folder in your screen shot. So it appears your system is having problems addressing that folder/drive.

  7. #7
    Registered User
    Join Date
    03-08-2010
    Location
    Sweden
    MS-Off Ver
    MS Office 365 Mac and Windows
    Posts
    94

    Re: Macro not working correctly, what did I do wrong?

    It's on an Windows Server 2003, I restarted the server and tried again... still the same problem...

    I then moved the files to C:\xxx and it worked...

    This is a strange habit...what can cause this? Its an admin account so it has all...

    Unfortunately C:\ is not the best place...

    Thanks for the time

  8. #8
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Macro not working correctly, what did I do wrong?

    Windows Server does have significant security, something I can't comment on.

    You have a working macro and know where to use it so that it does work, I think that's all the help I'll be able to give. Someone with expertise in Server securities may have some advice for configuring your server, probably a different forum.

    Meanwhile, you have a tool you can use, albeit on a drive you'd prefer not to.

    Please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

  9. #9
    Registered User
    Join Date
    03-08-2010
    Location
    Sweden
    MS-Off Ver
    MS Office 365 Mac and Windows
    Posts
    94

    Re: Macro not working correctly, what did I do wrong?

    Ohhh I am not complaining!!

    It works great, but unfortunately on the wrong drive. I have to live with that and see if I can fix it. I do run batch code (DOS) that does not have this problem..

    Thanks again

  10. #10
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Macro not working correctly, what did I do wrong?

    I didn't think you were complaining. No worries.

+ 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