PDA

View Full Version : Problem with OnAction



palbiro
06-01-2012, 01:43 AM
Hi,

I have an Excel VBA macro, I run it from C:\temp.

I have a problem with the following line:

Sheets(F).Shapes("M").OnAction = "2012.xlsm!Copy"
In the F sheet to the button M the macro assigment is "C:\temp\2012.xlsm!Copy"

1. question: why put it the path (C:\temp) there (I can see from the debugger)

2. question:
Under 2003 it worked perfect.
In Excel 2010 it doesn't work, it can't find the 2012.xlms!Copy. How can I correct it?

Thanks very much

palbiro
06-02-2012, 02:28 AM
Sorry,

I think I have to explain my problem more precisely:
In the zip's Result directory there are pictures to show the process.

To test the situation, after unzip test and temp directory you have to start the Test/test.xlms and stop the debugger at the line a=1,
You can check in button.xlms the macro assigment to button M is "C:\temp\MacroTreasury.xlms!Copy".
After run, you get an error, the macro is not available.

How can I achieve to have always an absolut path in the macro assigment.

The process worked perfect under Excel 2003, but I have to switch the whole (quite big) application to Excel 2010.

Thank very much
Paul

Paul_Hossler
06-02-2012, 08:31 AM
Under 2003 it worked perfect.
In Excel 2010 it doesn't work, it can't find the 2012.xlms!Copy. How can I correct it?


What were the operating systems for the 2003 and the 2010 versions?

Paul

fredlo2010
06-02-2012, 09:10 AM
hi,

I tested your workbook and its working fine. It asked me to recheck the data links sources though, maybe you wanna do that.

I think your picture 3error is telling you that.