Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Excel Macro
#1
I am having a Excel file having Excel Macro embedded. The simplest way to call that excel macro will to pass it the keyboard shortcut throgh QM. Is it possible to embed that macro in QM as a code piece rather than passing the keys to excel. The Excel Macro contains processes of sorting list, auto fitting etc.
#2
run excel macro from qm without keyboard
Macro
Code:
Copy      Help
;/exe 1
ExcelSheet es.Init
es.ws.Application.Run("excel macro name")
#3
The problem is each QM code is run a new excel file is to be created so the macro cannot be called.
#4
You say you can run the excel macro using keyboard shortcut. Then es.ws.Application.Run also should work.

Or you can convert the excel macro to QM. You cannot simply embed it in QM. Some changes needed.
#5
My mistake earlier I did not told you that a new file will be created so the first one will not work. How can I convert a excel macro to QM. Just provide me an example where the opened excel file columns are selected and format is set to "0.00". VB code this will be :
Range("E:E,G:G,I:I,J:J,K:K,L:L").Select
Range("L1").Activate
Selection.NumberFormat = "#,##0.00"
#6
Macro
Code:
Copy      Help
;/exe 1
ExcelSheet es.Init
IDispatch a=es.ws.Application

a.Range("E:E,G:G,I:I,J:J,K:K,L:L").Select
a.Range("L1").Activate
a.Selection.NumberFormat = "#,##0.00"

As you see, i only appended a. to every function. Other macros may require some more changes. For example, join lines when split using _.
#7
Excellenttttt
#8
OK one example for sorting also.


Forum Jump:


Users browsing this thread: 1 Guest(s)