+ Reply to Thread
Results 1 to 6 of 6

macro executing but without effect

  1. #1
    Forum Contributor
    Join Date
    03-24-2009
    Location
    Vietnam
    MS-Off Ver
    Excel 2010
    Posts
    382

    macro executing but without effect

    My macro for importing pictures from a selected folder suddenly stopped working... and I cannot recall making any changes. Maybe someone has any clue why.

    Generate a window for folder selection
    Please Login or Register  to view this content.
    Sub
    Please Login or Register  to view this content.
    Interestingly, when I use one of my 2 alternatives, it works perfectly, but the actual method would include the selection of a folder, the alternatives not.

    Maybe someone has an idea! I assume the error lies within my sub (InsertAllPictures).

    Thanks!
    A2k
    Last edited by Armitage2k; 08-12-2009 at 04:22 AM.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: macro does... nothing?

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution. Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.
    To change a Title on your post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Forum Contributor
    Join Date
    03-24-2009
    Location
    Vietnam
    MS-Off Ver
    Excel 2010
    Posts
    382

    Re: macro executing but without effect

    Absolutely no idea...?

  4. #4
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: macro executing but without effect

    You haven't actually told us what is happening.
    Remember what the dormouse said
    Feed your head

  5. #5
    Forum Contributor
    Join Date
    03-24-2009
    Location
    Vietnam
    MS-Off Ver
    Excel 2010
    Posts
    382

    Re: macro executing but without effect

    ... I knew there was something...

    Very well, after doing some research on my own, by returning several variables in msgboxes to see if the value is correct, I found that one variable cannot be echoed/displayed.

    Please Login or Register  to view this content.
    A few words to the macro in general. I use this macro to let the user select a folder which contains several .bmp files. after selection, all bmp files are supposed to be imported into the current sheet, cropped and positioned in column A (starting from A3 downwards).

    Now, for unknown reasons the macro stopped working (i checked if macros are enabled...) thus I am doing a little inspection and this resulted in finding that the strFileName variable apparently does not work anymore.

    Solution:
    I would need an alternative way to have to filter all .bmp files in the selected folder, and then let the remaining macro do the rest.
    I tested the macro by hardcoding the path into the script and it runs without problems. Thus, the problem must be with the strFileName variable.

    Hope someone can give me a hand please.
    Thanks!
    A2k

  6. #6
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: macro executing but without effect

    That doesn't actually appear in the code you posted. This does:
    Please Login or Register  to view this content.
    if the actual code is what you posted just now then you are missing a backslash. If not, I'd have to guess there aren't any .bmp files in that folder.

+ 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