macros

opening worksheet in background

here's the process that i am running from a macro: i open a worksheet i add data to the worksheet i save it i close it and i repeat the steps: 1, 2, 3... etc. (when i say I, i mean the stupid macro) is it possible to open the worksheet in the background so that the user doesnt actually see that the worksheet is being opened? ...

Transmit a Word file to a database or FTP at the click of a button?

I would like to be able to send the contents of a merged word document to a database, either on a button click on the menu bar, or when closed (if saved). I've found some working code but have a problem trying to modify it (VBA noob) 'Written: June 11, 2008 'Author: Leith Ross 'Open the Internet object Private Declare Function Inter...

In C and C++, can I use macros definitions containing space?

Hello, I am wondering if macro definitions can contain space. Let's take for example this code: #define MACRO_PARAM int param2 int function(int param1, MACRO_PARAM) { return param1+param2; } This works ok with Visual Studio 8 and gcc 3.4.5 (mingw). For me this is good enough for the moment but is this standard? or can I rely on ...

Why so many parentheses in SUCCEEDED macro?

Windows SDK features SUCCEEDED macro: #define SUCCEEDED(hr) (((HRESULT)(hr)) >= 0) -----------------------^-------------^----- clearly as with other macros there're parentheses to ensure right interpretation of the intent by compiler. What I don't get is why there're parentheses around (HRESULT)(hr) (I marked them with ^ character). ...

How do I write a macro-defining macro in common lisp

I have about two macros (and climbing) in my codebase that look like this: (defmacro def-stat-method (method-name stat) `(progn (defmethod ,method-name ((monster monster)) (getf (stats monster) ,stat)) (defmethod (setf ,method-name) (value (monster monster)) (setf (getf (stats monster) ,stat) value)))) and th...

obfuscation macro

I've been looking into obfuscation software, but wondered if one could do it easily with a macro. If you go into the class diagram in visual studio 2010, you can easily click on class names, properties, fields, etc, and rename them from something meaningful to a, aa, aaa, abc, whatever. In a really small project, this would be really eas...

Macros Using GAS

I'm building a program for ARM Linux using GAS, but I want to do some macros to make my development some more smart. Then I want to know: How could I do a macro for this: (x+y*240)*2, were x and y are int, that will be used like this: mov r0, MACRO_SHOULD_BE_CALLED_HERE And how could I do a macro that should be called like this: JUS...

How to run multiple macro instances using Remote Dekstop Connection and Amazon AWS EC2

I am trying to to run multiple Remote Desktop connection instances with Amazon's AWS EC2 and keep a macro file running on each instance via Macro Express (installed separately on each node), but each time I minimize an instance, the the mouse movement of that macro freezes and the process is suspended. Since these macros that I am runni...

query-replace for macros in emacs?

I use the builtin f3/f4 bindings in emacs a lot to record and repeat macros, and find it to be a very powerful and useful feature, especially when combined with search. However, I noticed recently that whenever I do a query-replace (M-S-5 by default) that recording my macro stops! Is there a way to prevent this? I know that query-replace...

vba collection maximum size

here's my code: Sub isdofsodjisf48023jroi23f984444444jiodfiosj12348023jroi23f98() Dim colFiles As New Collection RecursiveDir colFiles, "C:\Documents and Settings\Alex Gordon\Desktop\testing\files\", "*.xls", True Dim vFile As Variant For Each vFile In colFiles Call writeincells(vFile) Next vFile End Sub P...

Access 2007 Macro Designer - Get and reuse parameter from user

I have a simple Access macro that opens two forms and filters them based on input from the user. I used parameter queries to accomplish this, so my Where condition for both reports reads: [PONumber]=[Enter PO Number] As it currently stands, an input box pops up twice - once for each report. I was hoping that I could somehow re-use t...

working with HUGE spreadsheet

i have about 300,000 records in this spreadsheet. and there are a couple hundred columns!! one of the columns is the social security number and i need to replace it with some random identifier. i cant really do a vlookup because that is too taxing so i think i am going to write a macro can anyone please suggest to me how do i do this? ...

Macro variable after class keyword

I found this in Ogre Framework class _OgreSampleClassExport Sample_Character : public SdkSample { ... ... and it's define like this #define _OgreSampleClassExport Why we want to have this macro variable? ...

Macro in Delmia

Hi , I am programming some VBA macros in Delmia with interface to make easier the life of the user. I know, in Delmia, there is the option to "Start Recording" macro, then I can make some operation in delmia and see the code generated by these operations. But when I click, by example, on "Restore initial state". There is no code genera...

Need meta-programming magic to define a mother lode of bit fields in an error-free way.

The goal is to control which types of users are allowed to perform which operations at the UI level. This code has been in place for a while; I just want to improve it a bit. The file which I am trying to improve should probably be auto-generated, but that would be too big of a change, so I seek a simpler solution. A file which we shall...

Bookmarklet to open user defined link and make user defined form drop-down box selections

I've written a bookmarlet to open a user defined web link, in this specific case a specific genomic location in the UCSC genome broswer. javascript:d=%22%22+(window.getSelection?window.getSelection():document.getSelection?document.getSelection():document.selection.createRange().text);d=d.replace(/%5Cr%5Cn%7C%5Cr%7C%5Cn/g,%22%20,%22);if(...

How to get the workaround for GCC warning, "the address of XXX will never be NULL"?

Hi, all. I'm working on C program. There is a function which takes two pointer argument and does some complex works. Let's say it as 'cmp'. cmp() is never complex for the illustrative reason. int cmp(struct foo *a, struct foo *b) { return (a->bar == b->bar); } I'd like to make a NULL-check macro, like this: #define SAFE_CMP(a,b...

Loop this Excel Macro ?

Hi Guys, I have this macro Sub Search() Range("H2").Select ActiveCell.FormulaR1C1 = "=IF(ISNUMBER(SEARCH(R16C6,RC[4])),RC[2],"""")" ' Edit RXX value Range("H2").Select Selection.AutoFill Destination:=Range("H2:H385") Range("H2:H385").Select Range("G16").Select ' Edit GXX value ActiveCell.FormulaR1C1 = "=SpecialConcatenate(C[1])" Range...

Make macros and functions integrate more seamlessly

OK, I understand pretty well how to use both function and macros. What I'm curious about is why the compiler can't be a bit more clever when integrating the two, e.g. consider the Clojure code: (defmacro wonky-add [a b] `(+ ~a (* 2 ~b))) (defn wonky-increment [a] (apply wonky-add a 1)) => Error: can't take value of a macro Yes, I kn...

C macro without arguments/parameters

I was browsing some code and I came across this macro definition #define D(x) do { } while (0) And its used in the code like this, D(("couldn't identify user %s", user)); I ran the code, and that particular line doesn't do anything. So, why would some one define a macro like that? In case you're wondering, that macro is defined in...