as many, i must declare my income tax, and i do it partially via an excel document.
Situation:
One excel file, containing 12 tabs labeled from january to december.
Rows are free as they will contain the purpose of the income/expense, the amount of it.
Colums are already filled with categories: food, gas, train ticket, professional taxes and so on......
My goal:
say i want to declare i spent for professional travel a 200€ train ticket.
Category is colum H, amount will be in row 4 : so i want QM to put value 200 in cell H:4
i tried all day to achieve that with no luck, by trying to adapt some code in the help files.
(from doc)
str a3 b3
ExcelSheet es.Init
es.GetCell(a3 1 3)
es.GetCell(b3 2 3)
out a3
out b3
This one triggers an error (Error (RT) in Macro name: 0x80004002, Cette interface n’est pas prise en charge) which can be translated to
"this interface is not handled, can not be used ,even is not declared)
I use Office 2007 under Windows 7.
I think i could do better, but i can't find documentation for all the functions if i try to use excel
via the COM interface thing
(from doc)
Excel.Workbook x._getfile("$desktop$\Book5.xls")
Excel.Application a=x.Application
a.Visible=TRUE; err
Excel.Windows ws=a.Windows
Excel.Window w=ws.Item(1)
w.Visible=TRUE
the code works, but i can't go further as i don't understand what mean Workbook, Workbooks, ws and
so on. If you could steer me to the place where i can find the API definitions.....
Possibly the first code does not work because QM and Excel run in different UAC integrity levels.
Let the macro run in separate process as User. Set it in Properties dialog.
For the second code reference, look in Excel Help.
F1, Table of Contents, Microsoft Excel Visual Basic Reference.
It is in Excel 2003. I think in 2007 similar.
But easier to use ExcelSheet. You can attach Worksheet to ExcelSheet.
that did work, you're a magician. no changing user stuff needed.
but i tried to access a specific cell and did:
es.SelectCell(4 9)
and i got:
Error (RT) in My First Macro: 0x80020009, Une exception s’est produite (an exception occurred).
0x3EC: La méthode Select de la classe Range a échoué (Select method of Range class failed.)
BTW, how can i have a "what row number am i located in" stuff, it's the last thing i need
to be able to fill my income tax, when the macro work with a filled sheet?
thanks.
PS: if needed, i can send you in PM the file so you can test
1) UAC stuff, as i must run excel as administrator to have all quite working...grrr
2) some routines seem (not sure though) mismatch declarations with my foreign language.
so some windows are not properly identified (class instead of name or title should do the trick).
QM Excel functions don't work with Excel if Excel is running as admin. Maybe because QM running as admin also is uiAccess, which is slightly different from pure admin integrity level.
Let Excel run normally, not as admin. Let macros that use Excel functions run in separate process as User. You can set it in Properties dialog.
ExcelSheet does not use Excel window name or class. Only program name. Isn't it EXCEL?
1. Create new empty macro. Assign shell menu trigger with icon, and also check Submenu checkbox. The macro will be used only for the submenu and will not run.
2. It will be in next QM, this month.
Fn probably cannot be remapped to a modifier key (Shift etc) because does not have "pressed" state.
Yes.
Create two macros, copy the triggers from my previous post, and paste in the Trigger field in the toolbar for each macro. Then right click a file in Explorer. You'll see a submenu with QM icon, containing 1 item.
If you already have a submenu, it is automatically created when labels of submenu items are like "Submenu Name\Item Name".
To add icon to the submenu, create macro for it. Name and text not important. Assign shell menu trigger. Let Label be "Submenu Name". Assign icon and check Submenu.
;Adds macros to the shell menu. The menu is shown when you ;right-click a file in Windows Explorer, Desktop, etc.
,;HOW TO ADD A MACRO TO THE SHELL MENU
;To add a macro to the shell menu, assign it trigger of ;"Shell menu" type (in Properties). The macro runs when you ;click the menu item. It receives the list of selected files.
;To add the macro to the shell menu, specify at least menu ;item label. To add it to a submenu, enter submenu label, ;backslash, and menu item label, eg Submenu\My Macro. ;The submenu is created automatically if does not exist ;(read more below).
;By default, the macro is added to the menu for all files. ;To add it only for certain file types, enter one or more ;extensions separated by space, eg txt doc rtf. For files ;with no extension, use <noextension>.
;If you specify one or more strings in "Folders" field, ;the menu item will be displayed only if the path of the ;selected file(s) begins with one of these strings.
;You can specify an icon file for the menu item, eg &my ;qm$\xxx.ico. It can be ico, bmp or other file. You can ;specify icon index, eg icons.dll,4. In the main menu don't ;use many icons from executable files, because they are ;extracted slowly.
;Description - text that Windows Explorer will display in ;the status bar. ; ;You don't have to explicitly create macros for submenus, ;unless you want to assign file types, icon and ;description to the submenu. If you assign file types to a ;submenu, you don't have to assign file types to its child ;items, unless you want to assign them only some of these ;file types, or except some of these file types.
,;NOTES
;The number of menu items you can add is limited. On WinXP ;it is ~150.
;Part of the trigger type is implemented as user-defined ;trigger. Another part is qmshlex.dll.
;When there are one or more non-disabled triggers of this ;type, you can see shell_menu_triggers in the Threads list.
OK, seems to work now, i was idiotic to check "submenu" property on the...submenu (aka 2nd item) menu.
Assigning an icon to the submenu does give an icon to it too.
QM is hard to tame sometimes.....
Thanks for your patience Gintaras, you're an angel