Senin, 30 April 2012

RE: [ExcelVBA] VBA stops to run

 

Possibilities are:

The workbook is opened as read-only
You do not have write permissions in the directory holding the workbook
There is a macro in the workbook which is triggered when you save it
The workbook is not the active workbook at the time you issue the command
The code saves the workbook but the next command is defective

Try stepping through the code and checking what happens then.

Best Regards
David Grugeon
Excel VBA Group Moderator

-----Original Message-----
From: ExcelVBA@yahoogroups.com [mailto:ExcelVBA@yahoogroups.com] On Behalf
Of Flavio
Sent: Saturday, 28 April 2012 1:00 AM
To: ExcelVBA@yahoogroups.com
Subject: [ExcelVBA] VBA stops to run

Good morning gentlemen, i need some support..

I did a code to import the content from some spreadsheets. Those
spreadsheets that i'm importing has macros. I opened, and imported the data.
The problem is that after that i need to do one change, save, and close the
spreadsheet.

When i try to save the spreadsheet, the code just stops to work. Just stop.
I already tried some things, but none of them really worked.

Detail: I'm working with excel 2010, but saved my spreadsheet in the format
.xls. The spreadsheets that i'm opening also have this format.

In the first version that i did, it shown the compatibility checker screen,
warning me about "significant loss of funcionality". I clicked in continue.
So after that the code stops, as soon as i execute the instruction
ActiveWorkbook.Save

After that i created a second version from my program, with 3 lines before i
save:
Application.DisplayAlerts = False
Application.EnableEvents = False
ActiveWorkbook.CheckCompatibility = False

The compatibility checker message was gone, but the code still stops to run,
in the same line ActiveWorkbook.Save.

I appreciate any help about. I tried to think in different solutions, but
right now i dont have a clue why this is happening.

Regards to all
Flavio

------------------------------------

----------------------------------
Be sure to check out TechTrax Ezine for many, free Excel VBA articles! Go
here: http://www.mousetrax.com/techtrax to enter the ezine, then search the
ARCHIVES for EXCEL VBA.

----------------------------------
Visit our ExcelVBA group home page for more info and support files:
http://groups.yahoo.com/group/ExcelVBA

----------------------------------
More free tutorials and resources available at:
http://www.mousetrax.com

----------------------------------Yahoo! Groups Links

__._,_.___
Recent Activity:
----------------------------------
Be sure to check out TechTrax Ezine for many, free Excel VBA articles! Go here: http://www.mousetrax.com/techtrax to enter the ezine, then search the ARCHIVES for EXCEL VBA.

----------------------------------
Visit our ExcelVBA group home page for more info and support files:
http://groups.yahoo.com/group/ExcelVBA

----------------------------------
More free tutorials and resources available at:
http://www.mousetrax.com

----------------------------------
.

__,_._,___

Tidak ada komentar:

Posting Komentar