+ Reply to Thread
Results 1 to 6 of 6

Macro Opening Wrong File - Code Attached

  1. #1
    Registered User
    Join Date
    06-17-2014
    Location
    US
    MS-Off Ver
    2013
    Posts
    29

    Macro Opening Wrong File - Code Attached

    Hello,

    I have a macro that keeps wanting to open version 4 of a file (the one I created it in), even when I have version 5 open.

    If you could take a quick peak at my code and tell me what's going on, I would appreciate it!

    See attached.

    Thanks in advance!
    Justin
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    06-17-2014
    Location
    US
    MS-Off Ver
    2013
    Posts
    29

    Re: Macro Opening Wrong File - Code Attached

    Hey I'm new to this macro thing. Should I post the code here rather than the file so that no one is afraid of me sending a virus or something through the code?

  3. #3
    Forum Contributor HerryMarkowitz's Avatar
    Join Date
    09-10-2012
    Location
    Europe
    MS-Off Ver
    Office 2021 - Win10
    Posts
    1,008

    Re: Macro Opening Wrong File - Code Attached

    Hi,
    Your file ThisWorkbook part includes that code;
    Please Login or Register  to view this content.
    Even you delete that code your pivottable and pivotcharts works properly...

    What is your question clearly ?
    Sub DontForgetThese()
         If Your thread includes any code Then Please use code tags...
         If Your thread has been solved Then Please mark as solved...
         If Anybody has helped to you Then Please add reputation...
    End Sub

  4. #4
    Registered User
    Join Date
    06-17-2014
    Location
    US
    MS-Off Ver
    2013
    Posts
    29

    Re: Macro Opening Wrong File - Code Attached

    Hi Herry,

    Thanks for the response!

    For whatever reason, when I open the file I attached earlier in the thread, the macro automatically opens another file on my hard drive and runs the macro in that file....and I can't figure out why its doing that.
    Any suggestions?

    Thanks!
    Justin

  5. #5
    Forum Contributor HerryMarkowitz's Avatar
    Join Date
    09-10-2012
    Location
    Europe
    MS-Off Ver
    Office 2021 - Win10
    Posts
    1,008

    Re: Macro Opening Wrong File - Code Attached

    I cant find any reason why it is doing that...
    Are you sure attached file includes everything?
    Last edited by HerryMarkowitz; 09-18-2014 at 06:36 PM.

  6. #6
    Registered User
    Join Date
    06-17-2014
    Location
    US
    MS-Off Ver
    2013
    Posts
    29

    Re: Macro Opening Wrong File - Code Attached

    Hey I just discovered the problem! When I run it from the vba window with f5, it works. I had been trying to run it from the "CKS Macros" tab in the ribbon. That's when it wants to open the other file...odd.

    Maybe if you could help me with that, that would be great. Otherwise, no problem...I'll mark it solved.

    Thanks again!

+ 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. Autofilter Macro Failing - Run-time error 91 - full macro code is attached
    By evamarie in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-07-2013, 02:36 PM
  2. code error while selecting a range-file attached
    By SMILE in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-26-2011, 06:02 AM
  3. macro code to change file-opening password
    By arunjoshi in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-16-2005, 03:49 AM
  4. Hyperlink; wrong file opening
    By Optiker in forum Excel General
    Replies: 0
    Last Post: 05-10-2005, 12:29 PM
  5. [SOLVED] Code to select 'Disable Macro' when opening an EXTERNAL FILE
    By G rumpy O ld D uffer in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-22-2005, 02:06 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