+ Reply to Thread
Results 1 to 2 of 2

Macro changes format in the opened spreadsheet

  1. #1
    Registered User
    Join Date
    02-13-2022
    Location
    Vilnius
    MS-Off Ver
    MS Office 16.0.14326.20702) 32-bit
    Posts
    1

    Macro changes format in the opened spreadsheet

    Hello,

    I have a macro which opens and .XLS file in the first step. If I open the file manually, I always get message 'The file format and extension of 'XXX.XLS' don't match. The file could be corrupted or unsafe. Unless you trust its source, don't open it. Do you want to open it anyway? 'and click 'Yes'. When the file is opened by my macro, the data format gets changed:

    1. All cells with numbers get the green triangle in the corner which required to 'Convert to Number'
    2. In one particular column all amounts become incorrect: original amount 19 changes to 19.000; 7 --> 7.000 etc.

    Please advise how to write the macro command to open my spreadsheet so that the data is not changed.

    Thanks in advance.
    Attached Images Attached Images

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

    Arrow Re: Macro changes format in the opened spreadsheet


    Hello,

    according to the obvious message try first to rename the file with the correct extension …

+ 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. Excel macro to restrict one spreadsheet to be opened at a time
    By clprdctn in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-23-2018, 10:32 PM
  2. Test if spreadsheet has ever been opened
    By projecttoday in forum Excel General
    Replies: 2
    Last Post: 04-17-2014, 09:09 AM
  3. [SOLVED] Copying from one spreadsheet to another when both are opened
    By Jay147 in forum Excel General
    Replies: 3
    Last Post: 11-15-2013, 12:54 PM
  4. Replies: 0
    Last Post: 05-10-2013, 12:44 PM
  5. [SOLVED] Format Spreadsheet Macro
    By Hovander in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-05-2012, 05:54 PM
  6. macro to automatically run when spreadsheet is opened
    By penfold in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-19-2008, 08:52 AM
  7. spreadsheet with macro does not work in Excel 2000 opened in Internet Explorer
    By jt54 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-05-2006, 04:14 PM

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