8 posts / 0 new
Last post
Tried Fixing Code...New Problem

Hi,
 
I am a Macbook user using Excel for Mac as part of the Microsoft office software. I am trying to upload data from an online published dataset saved as "dataset.csv" and want to upload this data to the data editor that i downloaded from statplanet plus. I cleared the data on the data editor, allowed macros, edited the links to update when I changed them on the excel file. My first problem was when I clicked Import data I received a Run Time Error 1004 stating  " DataFile = Application.GetOpenFilename("All files (*.*), *.*", , "Please select a file to import")" . I changed this to "datafile=application.getopenfilename()" and then tried importing the data again. However, now, it loads a little bit and says Run Time Error 1004 "excel cannot find the matching data to replace. no cell in the selection contains what you typed, or no records match the criteria". The debugger brings me to this code "ActiveWorkbook.Close savechanges:=False" and I do not know what to do here. Please help in any way. The dataset that we have lists the states, the year, and the number of cases of a disease in three columns. thanks so much.
 
"

A picture of the dataset can be found at this URL:

http://imgur.com/QDGYmBD

StatSilk's picture

Hi,
There is one issue with the structure which is that there should be only one state per row, so all data for that state would need to be in that row. An example data file structured for importing can be found here: http://www.statsilk.com/files/resources/data_example_for_import_worldmap...

However, that cannot be the cause of the error you mention. It would be useful to have a look at the data file if it can be shared, and/or get an exact line nr where the debug error occurs (or a print screen). The line/column numbers are normally displayed in the toolbar above the visual basic editor.
Best,
Frank

davidtajgman's picture

Hi.
I have exactly the same issue as Barbara. I am unable to "Import data" because on click of "Import data" button I receive an error message and the run time error 1004 troubleshooter takes me to precisely the same code line that Barbara refers to. Of course, the dialogue box for selecting a file does not open at all; the error message intervenes. What is wrong with this line of code? (I too am using a Mac running Excel for Mac 2011.)
Many thanks in advance for your assistance.
David Tajgman

davidtajgman's picture

Hello again.
I have read the older posting, with your instruction to change the code by removing what was written between the parenthesis. Now the dialogue window opens properly, and I was able to select the file included with the StatPlanet download entitled data_example_for_import_worldmap.xls. But a run error dialogue appears, with the trouble shooter taking me to the line "ActiveWorkbook.Close savechanges:=False". Additionally the file selected to import opens (not as imported data, but simply as an ordinary Excel file) and a fresh, new Excel file opens which looks to me to be the results of the import, although I cannot say for sure.
So, I am wondering if you have a solution to this problem? And whether StatPlanet has generally been confirmed to work on Mac.
Thanks again.
David

StatSilk's picture

Hi David,
Sorry to hear about this issue. StatPlanet has been confirmed to work on the Mac but this might be specific to the version of Excel you are using. Would you be able to click on 'debug' and indicate the line number where the error occurs (which should be somewhere in the top of the debug screen). It would also be useful if you could indicate the exact error message given by Excel. Many thanks.

Best,

Frank

Frank,
I am at the exact place in the workflow problem where David was. I receive the error message shown here: http://www.flickr.com/photos/51291466@N00/12372117623/. When I click on debug, it does not take me to the debugger. Instead, it opens the 'import names' worksheet (http://www.flickr.com/photos/51291466@N00/12372117623/).
I really appreciate your help. I am hopeful I can use this software with my Mac but a little uncertain.
Thanks! Lisa

StatSilk's picture

Hi Lisa,

Thanks for the screenshots. Perhaps when you switch windows you can find the visual basic editor (debug screen). The problematic code should hopefully be highlighted. Otherwise here are some instructions to open up the visual basic editor manually: http://www.techonthenet.com/excel/macros/visual_basic_editor2011.php.

It would be great if you could identify the exact line where the error occurs. Thanks in advance!

Frank

USER LOGIN