+ Reply to Thread
Results 1 to 9 of 9

Excel 2007 vba code on sheet disappears when placed on Windows 10

  1. #1
    Registered User
    Join Date
    02-23-2024
    Location
    Sydney, Australia
    MS-Off Ver
    Office Excel 2007
    Posts
    3

    Post Excel 2007 vba code on sheet disappears when placed on Windows 10

    Copied excel sheet workbook containing check boxes to another windows 10 machine and check box properties are lost/overwritten. Just remains as properties. done this multiple times.
    The is some vba code behind it and no longer viewable in the vba sheet properties window.
    Using Excel 2007 as the most compatible with this sheet on the Windows 10 environment.
    Have repaired excel 2007 and rolled back the last windows 10 update.
    I know windows 10 does not want to run vba code as risk of it being a virus.
    If i retype the vba code it does not redisplay on save and reopen.
    Any ideas.

    Charity has a simple excel program written prior to 2010 for invoicing.
    Contains check boxes on each line.
    Excel sheet works on other windows 10 machines.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Excel 2007 vba code on sheet disappears when placed on Windows 10

    Welcome to the Forum Domputer!

    Quote Originally Posted by Domputer View Post
    I know windows 10 does not want to run vba code as risk of it being a virus.
    This is nothing new in Windows 10. It's been like for quite a while, and it's in the Excel settings, not Windows setting.

    Even if VBA is prevented from running, it is not wiped out of the file.

    What versions of Excel are running on the original machine, and the machine you are copying to? How are you doing the copy? I am wondering if there is some corruption occurring when the file is received there.

    Since it works on other machines, it is likely there is some problem with the target machine. May be difficult to diagnose without access to the machine.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    02-23-2024
    Location
    Sydney, Australia
    MS-Off Ver
    Office Excel 2007
    Posts
    3

    Re: Excel 2007 vba code on sheet disappears when placed on Windows 10

    Thanks for the prompt response Jeff.
    Excel 2007 is on both machines.
    Agree with you 100% that the vba code is not removed but just restricted or hidden on the new Windows 10 machine.
    I copied back the excel file from the problem machine back to the original machine and it works and the vba code is visible again.

    There must be something on that particular Windows 10 version that is restricting vba code from executing.
    As the excel settings for macros, activex, etc have been enabled.

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Excel 2007 vba code on sheet disappears when placed on Windows 10

    I am pretty sure this is not at all related to the Windows OS. Even if macros are disabled, the user is allowed to access the VBA code. You just can't run it.

    I do not know if any Excel or Windows setting that would disable access to the VBA code on one machine while allowing it on another machine for the same file. The file can have protections to lock the VBA project, but that is internal to the file and would apply on any machine.

    Whatever it is, it's specific to that machine. I will come back if I have other ideas, but it sounds like you have already checked the things I would recommend.
    Last edited by 6StringJazzer; 03-07-2024 at 11:37 PM.

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,463

    Re: Excel 2007 vba code on sheet disappears when placed on Windows 10

    Maybe you saved the code for the check boxes in your Personal.xlsb macro file?
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  6. #6
    Registered User
    Join Date
    02-23-2024
    Location
    Sydney, Australia
    MS-Off Ver
    Office Excel 2007
    Posts
    3

    Re: Excel 2007 vba code on sheet disappears when placed on Windows 10

    Thx 6StringJazzer, agree with all your comments.
    Suspect it's the windows 10 updates installed. Don't want to have to reinstall Windows 10.

    Thx TMS, there are no *.xlsb files on my machine. Therefore none to transfer to another machine.
    The excel workbook is already saved as *.xlsm Excel Macro Enabled

  7. #7
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,463

    Re: Excel 2007 vba code on sheet disappears when placed on Windows 10

    Can you redact a copy of the file and upload it here?

  8. #8
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Excel 2007 vba code on sheet disappears when placed on Windows 10

    Quote Originally Posted by Domputer View Post
    there are no *.xlsb files on my machine.
    PERSONAL.xlsb is a default file that is created in the XLSTART folder when Excel is installed. It is hidden by default and opened every time Excel is opened. Are you saying that you have deleted that file?

  9. #9
    Forum Contributor
    Join Date
    10-02-2012
    Location
    UK
    MS-Off Ver
    Office 365
    Posts
    252

    Re: Excel 2007 vba code on sheet disappears when placed on Windows 10

    We're assuming when you moved it to the windows 10 machine, you disabled the macro security on the file by right clicking on the file in the folder, selecting properties and checking the "Unblock" option?
    Attached Images Attached Images

+ 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. Replies: 7
    Last Post: 02-22-2019, 05:23 PM
  2. Worksheet created in 2007 (Windows XP, 32-bit) freezing in 2007 (Windows 7, 64-bit)
    By mhart210 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-14-2013, 10:58 AM
  3. Replies: 4
    Last Post: 06-20-2013, 09:30 AM
  4. Replies: 1
    Last Post: 02-06-2013, 06:13 PM
  5. VBA code works in Mac 2011, not Windows 2007?
    By Jedouard in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-31-2010, 01:40 PM
  6. Replies: 3
    Last Post: 07-13-2008, 03:13 AM

Tags for this Thread

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