Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Excel File...open, run macro, save and close.
#1
Guys,

I'm trying to make the follow macro ( It's very important for me):

1º run "C:\Documents\Price.xlsm" ;; it may take a few minutes, 'cause the file it's very heavy

2º select sheet "base" ;; there are a lot of sheets in that worksheet

3º run Macro1 ;; This is a VBA Macro...It could take a few minutes to run too

4º run Macro2 ;; another VBA Macro

5º Save

6º Close


Thanks a lot for helping.
#2
Macro Macro2430
Code:
Copy      Help
ExcelSheet x.Init("base" 1|4 "C:\Documents\Price.xlsm")
x.RunMacro("Macro1")
x.RunMacro("Macro2")
x.Close(1|16)
Not tested, may need to change something.
#3
Gintara,

Thanks a lot for helping. But It didn't work.

Error (RT) in Macro23: invalid argument sheet.

Could you please help me to adjust it ?
#4
Macro Macro20
Code:
Copy      Help
ExcelSheet x.Init("base" 1|4 "$Documents$\Price.xlsm")
x.RunMacro("Macro1")
x.RunMacro("Macro2")
x.Close(1|16)
#5
Maybe because the file is so heavy. Try this:
Macro Macro2430
Code:
Copy      Help
ExcelSheet x.Init("" 1|4 "C:\Documents\Price.xlsm")
mes- "Click OK when the file is loaded" "" "OC"
x.Activate(0 "base")
x.RunMacro("Macro1")
x.RunMacro("Macro2")
x.Close(1|16)
#6
It Worked!

Thanks a lot Gintara


Forum Jump:


Users browsing this thread: 1 Guest(s)