Macro to open a file

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
I have in 2 different macro the exactly same program to open a file. But in the first one, it is working and in the second one, the program stop after have opened the file.... He just stop as if there is an exit sub after my row.... In the exemple behind, the program does not do the 3rd line.... I am completly lost....
Thanks for any help

Public Sub openfillratio()

ChDir "H:\Charras"
Workbooks.Open Filename:="H:\Charras\Fill Ratio.xls"
Windows("temporaire.xls").Activate

End Sub
 
Are you using a shortcut key to start either of the macros? Is so, does the
shortcut key include the shift key as part of the shortcut combination. If
so, change it so it doesn't require the shift key.

--
Regards,
Tom Ogilvy

ben.c said:
Hi,
I have in 2 different macro the exactly same program to open a file. But
in the first one, it is working and in the second one, the program stop
after have opened the file.... He just stop as if there is an exit sub after
my row.... In the exemple behind, the program does not do the 3rd line.... I
am completly lost....
 
Yes, Yes, and Yes....it is working without the shift key in the short cut...
Do you know why the shift key does this ?
Thanks a lot for the answer, I was really disapointed.
 
When you hold down the shift key and open a file manually, it disables
macros. Apparently it has the same effect when you use a shortcut key that
includes a shift to fire the macro. When the workbook opens, the macro is
halted.
 
Back
Top