MrDB4Excel
Active Member
- Joined
- Jan 29, 2004
- Messages
- 348
- Office Version
- 2013
- Platform
- Windows
I am trying to get a macro to autorun when I open a workbook.
I want this macro to run automatically as soon as I have selected the "Update" selection that appears in the "This workbook contains links to one or more external sources that could be unsafe."
Obviously these sources exist only on my PC and thus are trusted, so this is not an issue.
When I select "Update" I expect the macro to autorun, but alas it does nothing.
The specific macro I want to run is called RunThemAll and it goes as follows:
Sub RunThemAll()
Range("T12").Select
Application.Run "USD2CZK"
Range("T14").Select
Application.Run "EUR2CZK"
Range("T16").Select
Application.Run "CZK2EUR"
Range("T18").Select
Application.Run "RUB2EUR"
Range("T20").Select
Application.Run "EUR2RUB"
Range("A2").Select
Range("J23").Select
End Sub
I have tried the following and all of these were inserted in a double click of "ThisWorkbook" and not added in a module.
Each of the Application.Run "USD2CZK", "EUR2CZK", "CZK2EUR", "RUB2EUR" & "EUR2RUB" all exist in separate modules as seen below in the RunThemAll macro.
What am I doing wrong?
Private Sub Workbook_Open()
Call RunThemAll
End Sub
&
Private Sub Workbook_Open()
Sub RunThemAll()
Range("T12").Select
Application.Run "USD2CZK"
Range("T14").Select
Application.Run "EUR2CZK"
Range("T16").Select
Application.Run "CZK2EUR"
Range("T18").Select
Application.Run "RUB2EUR"
Range("T20").Select
Application.Run "EUR2RUB"
Range("A2").Select
Range("J23").Select
End Sub
End Sub
&
Private Sub Workbook_Open()
End Sub
Sub RunThemAll()
Range("T12").Select
Application.Run "USD2CZK"
Range("T14").Select
Application.Run "EUR2CZK"
Range("T16").Select
Application.Run "CZK2EUR"
Range("T18").Select
Application.Run "RUB2EUR"
Range("T20").Select
Application.Run "EUR2RUB"
Range("A2").Select
Range("J23").Select
End Sub
I want this macro to run automatically as soon as I have selected the "Update" selection that appears in the "This workbook contains links to one or more external sources that could be unsafe."
Obviously these sources exist only on my PC and thus are trusted, so this is not an issue.
When I select "Update" I expect the macro to autorun, but alas it does nothing.
The specific macro I want to run is called RunThemAll and it goes as follows:
Sub RunThemAll()
Range("T12").Select
Application.Run "USD2CZK"
Range("T14").Select
Application.Run "EUR2CZK"
Range("T16").Select
Application.Run "CZK2EUR"
Range("T18").Select
Application.Run "RUB2EUR"
Range("T20").Select
Application.Run "EUR2RUB"
Range("A2").Select
Range("J23").Select
End Sub
I have tried the following and all of these were inserted in a double click of "ThisWorkbook" and not added in a module.
Each of the Application.Run "USD2CZK", "EUR2CZK", "CZK2EUR", "RUB2EUR" & "EUR2RUB" all exist in separate modules as seen below in the RunThemAll macro.
What am I doing wrong?
Private Sub Workbook_Open()
Call RunThemAll
End Sub
&
Private Sub Workbook_Open()
Sub RunThemAll()
Range("T12").Select
Application.Run "USD2CZK"
Range("T14").Select
Application.Run "EUR2CZK"
Range("T16").Select
Application.Run "CZK2EUR"
Range("T18").Select
Application.Run "RUB2EUR"
Range("T20").Select
Application.Run "EUR2RUB"
Range("A2").Select
Range("J23").Select
End Sub
End Sub
&
Private Sub Workbook_Open()
End Sub
Sub RunThemAll()
Range("T12").Select
Application.Run "USD2CZK"
Range("T14").Select
Application.Run "EUR2CZK"
Range("T16").Select
Application.Run "CZK2EUR"
Range("T18").Select
Application.Run "RUB2EUR"
Range("T20").Select
Application.Run "EUR2RUB"
Range("A2").Select
Range("J23").Select
End Sub