+ Reply to Thread
Results 1 to 11 of 11

VBA code Error after changed to windows 7, working fine in windows XP before

  1. #1
    Valued Forum Contributor
    Join Date
    03-28-2014
    Location
    Kuala Lumpur, Malaysia
    MS-Off Ver
    Excel 2016
    Posts
    696

    VBA code Error after changed to windows 7, working fine in windows XP before

    Hi,

    Can anyone help me,

    The code run perfectly in window XP but when I changed to windows 7 got runtime error

    Workbooks.Open Filename:=IName does not work. the filepath have not changed. remained as before

    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: VBA code Error after changed to windows 7, working fine in windows XP before

    I don't see any reason that code wouldn't work unless the filepath had changed.

    I'd suggest opening one of the workbooks in question and running some code like:
    Please Login or Register  to view this content.
    and comparing this to what you have in your filepath sheet.

  3. #3
    Valued Forum Contributor
    Join Date
    03-28-2014
    Location
    Kuala Lumpur, Malaysia
    MS-Off Ver
    Excel 2016
    Posts
    696

    Re: VBA code Error after changed to windows 7, working fine in windows XP before

    Hi,

    I have verified many times include your technique, the filepath is 100% accurate. Is it due to excel 2013 issue? a lot of files unable to open after changed to excel 2013. I dont think windows 7 issue.


    The protected view has been uncheck in trust center settings. It is really make me frustrated how come this thing happened?

  4. #4
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Re: VBA code Error after changed to windows 7, working fine in windows XP before


    Hi,

    I don't think it comes from 2013 version but how in your new Windows files are displayed !
    The workbook's name must be like in its title window once opened in Excel :
    you have to enter it with its correct extension like .xlsb, .xlsm or .xlsx …

    Regards !

  5. #5
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: VBA code Error after changed to windows 7, working fine in windows XP before

    Try doing something like:
    Please Login or Register  to view this content.
    and see if that works.

  6. #6
    Valued Forum Contributor
    Join Date
    03-28-2014
    Location
    Kuala Lumpur, Malaysia
    MS-Off Ver
    Excel 2016
    Posts
    696

    Re: VBA code Error after changed to windows 7, working fine in windows XP before

    Hi ragulduy,

    I have tried your code but have to select the file, not open automatically. but after selecting the file, its still unable to open.

    then i tried to open using IP address but error mesaages The Office File Validation feature has blocked this file from opening as it may contain harmful content.

    \\172.25.9.119\atm & sst\eSST Daily Uptime\eSST Daily Uptime Apr 2014\ATM\ATM Availability - 20140401.xls

    The filepath is absolutely correct. I have added Document location in quick access toolbar. also use run msgbox thisworkbook.fullname confirm 100% accurate filepath.
    Last edited by Faridwahidi; 04-11-2014 at 05:29 AM.

  7. #7
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: VBA code Error after changed to windows 7, working fine in windows XP before

    Are you running the code from within excel?

    Maybe try creating this folder:
    C:\Windows\SysWOW64\config\systemprofile\Desktop

    if it does not already exist.

  8. #8
    Valued Forum Contributor
    Join Date
    03-28-2014
    Location
    Kuala Lumpur, Malaysia
    MS-Off Ver
    Excel 2016
    Posts
    696

    Re: VBA code Error after changed to windows 7, working fine in windows XP before

    Hi,

    The files is not stored at my desktop. The files stored in another desktop mapped on my network drive

    Y:\eSST Daily Uptime\eSST Daily Uptime Apr 2014\ATM\ATM Availability - 20140401.xls



    The original Desktop path is on D:\ATM & SST\eSST Daily Uptime\eSST Daily Uptime Apr 2014\ATM\ATM Availability - 20140401.xls

    do i need to create C:\Windows\SysWOW64\config\systemprofile\Desktop in original desktop

  9. #9
    Valued Forum Contributor
    Join Date
    03-28-2014
    Location
    Kuala Lumpur, Malaysia
    MS-Off Ver
    Excel 2016
    Posts
    696

    Re: VBA code Error after changed to windows 7, working fine in windows XP before

    Hi ,

    If i record a macro the file path as follow,

    Please Login or Register  to view this content.

    does it due to excel 2013 protected view still working, even though has been uncheck?

  10. #10
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: VBA code Error after changed to windows 7, working fine in windows XP before

    Is there a folder:
    C:\Windows\SysWOW64\config\systemprofile\Desktop
    on your machine?
    If there is not, try and create it.

  11. #11
    Valued Forum Contributor
    Join Date
    03-28-2014
    Location
    Kuala Lumpur, Malaysia
    MS-Off Ver
    Excel 2016
    Posts
    696

    Re: VBA code Error after changed to windows 7, working fine in windows XP before

    Hi

    is it excel file format issue?

    FileFormat:=xlExcel8, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, CreateBackup:=False

+ 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. Macros created in Windows XP not opening /working in Windows 7
    By Janane in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-18-2012, 04:28 AM
  2. Getting this code to work on MAC (ERROR 68) - works fine on Windows
    By LT1511 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-30-2012, 11:09 PM
  3. Macro works fine on Windows XP, but it gives error on Vista or 7
    By maxxian in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-19-2012, 05:43 PM
  4. Macros working fine on Windows Excel, but not on Mac (Excel 2011)
    By mcstenger85 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-08-2012, 08:52 AM
  5. Macros working fine on Windows (Excel 2010), but not on Mac (Excel 2011)
    By six6to8eight in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 01-29-2012, 11:12 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