You are here:

Excel/Excel Macro Doesn't Workd

Advertisement


Question
Hi Bob,

This request for help may be redundant. I may have taken too long to write it and ultimately got a message that I had timed out. Sorry.
-  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  
You've solved my problems in the past perfectly, so here I am again. I am using Excel 2010.

I have two problems, I suspect both interrelated. A financial company with whom I deal can export, in Excel format, a particular report which has the data I want. The file I can download is named “Export.xls”, (note the filename extension), and when I try to open it in Excel 2010, I get a message that says: The file you are trying to open, “Export.xls” is in a different format than specified by the file extension. Verify that the file is not corrupted and is from a trusted source before opening the file. Do you want to open the file now? It offers three options: Yes, No, Help.

I click on Yes and open the file. I am able to manipulate the data manually without difficulty. I write some macro code for this spreadsheet and “save as” with the filename extension “.xlsm”.

In the macro I’ve written. Cell ("A2") is already selected when I open the file, which makes it my activecell and has a black border around the cell. I process some activity with the value in cell A2. Now I want to go to a different cell, specifically "C3". In the macro I include the following line of macro code:
    ActiveCell = ActiveCell.Offset(1,2)
to make it the activecell. BUT the black border does not move from cell A2 to cell C3 and C3 does not become the activecell. If I manually click on C3, it immediately captures the black border and is the activecell.

I've checked "protection" for the worksheet and have unchecked both "Locked" and "Hidden". That resulted in no change as far as activecell is concerned.

My questions:
1.   Why do I have a problem opening the file “Export.xls” and what should I do to make it a viable file in Excel 2010? What filename extension should I use?

2.   Why does my macro code not move the activecell with the macro code shown above?

Any guidance you can give me would be most appreciated. Thank you.

Bob Kunz

Answer
1 - no idea. should open fine. But you might as well ignore that message since it opens OK.
2 - the statement ActiveCell = ActiveCell.Offset(1,2) simply assigns the VALUE of C3 to the active cell; it doesn't move it. To move it, there are lots of ways, the easiest being Range("C3").Select. But you can also use Activecell.Offset(1,2).Select
About Excel
This topic answers questions related to Microsoft Excel spreadsheet (or workbook) stand-alone or Mircrosoft Office Excel including Excel 2003, Excel 2007, Office 2000, and Office XP. You can get Excel help on Excel formulas(or functions), Excell macros, charting in Excel, advanced features, and the general use of Excel. This does not provide a general Excel tutorial nor the basics of using a spreadsheet. It provides specific answers to using Microsoft Excel only. If you do not see your Excel question answered in this area then please ask an Excel question here

Excel

All Answers


Answers by Expert:


Ask Experts

Volunteer


Bob Umlas

Expertise

I`m a Microsoft Excel MVP (Most Valuable Professional) and have been since the inception of the program in 1995. I can answer every kind of Excel question except: API, Importing/exporting to other programs (powerpoint, word,...) Also check out my in-person training link at http://www.thumbtack.com/ny/new-york/excel-training/

Experience

Worked with MS Excel since version 0.99 (on the Mac!). Was contributing editor to Excellence Magazine, having written >300 articles. John Walkenbach said of me "I finally met someone who knows as much about Excel as I do."

Publications
Excellence, The Expert, Microsoft

Education/Credentials
BA in math, Hofstra University, 1965

Awards and Honors
MVP
Led sessions for the Convergence 2004-2006 seminar on Excel tips & tricks

©2016 About.com. All rights reserved.