macros

Can't assign macro in excel

I am having some trouble with macros in my excel workbook. I have a couple of auto-shapes on one of my sheets which are grouped together for drawings. 2 of these have macros assigned to them (as 'kitchen - 1.xls'!but59 and 'kitchen - 1.xls'!but60), but I can't seem to assign macros to the other 2 shapes. I have tried right clicking on...

Confused about C macro expansion and integer arithmetic

I have a couple of questions regarding the following snippet: #include<stdio.h> #define TOTAL_ELEMENTS (sizeof(array) / sizeof(array[0])) int array[] = {23,34,12,17,204,99,16}; int main() { int d; for(d=-1;d <= (TOTAL_ELEMENTS-2);d++) printf("%d\n",array[d+1]); return 0; } Here the output of the code does not print the array eleme...

Sort Excel Grouped Rows

I have a spreadsheet that has information in groups. The header row contain company names and information and then the grouped rows beneath them contain names of people in the company. Company Name | Number of Employees | Revenue | Employee Name | Email | Phone Is there anyway to sort by the number of employees and/or reve...

Learn Macros in Scheme from On Lisp

I really want to learn Scheme macros. I glanced over the content of "On Lisp" and a lot of the chapters have been devoted to Lisp macros. However I do not know common lisp. Can I use it to learn Scheme Macros? ...

What are some OOoBasic best practices?

What are some best practices for programming a OOoBasic program? So far I know you should use XRay but there are an awful lot of weird little quirks in there as well. ...

macros and IF statements

hi, i have 2 qns, hopefully simple enough for you to help me with. 1) i have 2 adjacent cells A and B. A is a validated list where it has 2 values. B should show something else that is dependent on A. my intention is to set this macro on a button and everytime the button is clicked, the 2 cells appear. 2) i have 4 cells- C, D, E. cells ...

Visual Studio Macros

I am creating a Visual Studio Macro and I want it to take the data it is generating and export it to SQL. I can't seem to find a good way to connect to a database from Visual Studio's VBA. Does anyone know of a good way to do this? I am running Visual Studio 2008 and SQL Server 2008. Thanks for any help ...

Passing multi-param function into a macro

Why does this not compile on VC 2005? bool isTrue(bool, bool) { return true; } void foo(); #define DO_IF(condition, ...) if (condition) foo(__VA_ARGS__); void run() { DO_IF(isTrue(true, true)); // error C2143: syntax error : missing ')' before 'constant' } Running this through the preprocessor alone outputs: bool isTrue(bo...

Seeing expanded C macros

If I want to expand a C macro, what are some good ways to do that (besides tracing it manually)? For instance, GTK_WIDGET_SET_FLAGS, it uses a macro that uses a macro that uses a macro (or two) ... I want to just see it somehow expanded automagically, instead of searching for every macro, every step of the way. UPDATE I tried cpp, bu...

What do __STDC_LIMIT_MACROS and __STDC_CONSTANT_MACROS mean?

I see this in the standard C++ libraries for my system, as well as some of the headers in a library I'm using. What are the semantics of these two definitions? Is there a good reference for #defines like this other than the source itself? ...

How do I bind a macro to a key in Word 2007 without recording a new macro?

As the title so eloquently put it, I need to know how (or if it's even possible) to bind a macro to a key in Microsoft Word 2007 without recording a new macro each time. I find myself writing new macros directly in code and then not being able to bind them to a key. Or I might just want to rebind a macro to another key. ...

Help me write a Clojure macro which automatically adds metadata to a function definition

Hi. I realize that the first rule of Macro Club is Don't Use Macros, so the following question is intended more as an exercise in learning Clojure than anything else (I realize this isn't necessarily the best use of macros). I want to write a simple macro which acts as a wrapper around a regular (defn) macro and winds up adding some me...

DTE.ExecuteCommand and wait

Hi, I would like use macros for publishing my webapplication project. The little problem is, DTE.ExecuteCommand run asynchronously, and I need to wait until the command is done. Example: DTE.Windows.Item(Constants.vsWindowKindSolutionExplorer).Activate() DTE.ActiveWindow.Object.GetItem("04 - Products\04 - Products.WSS").Select...

Word macro, storing the current selection (VBA)

Hi, I have a Word document that contains about 4000 form fields which I have to export afterwards to a database. The matter is that none of the 4000 fields have an information in the "Bookmark" field, thus I cannot get the information stored in them. I'm trying to create a macro to help the process of writing the bookmark (FormField.Nam...

what does this C++ macro do ?

This is for MSVC #define Get64B(hi, lo) ((((__int64)(hi)) << 32) | (unsigned int)(lo)) Specifically, what is the role of the 'operator <<' ? Thanks for your help ...

Question about round_up macro

#define ROUND_UP(N, S) ((((N) + (S) - 1) / (S)) * (S)) With the above macro, could someone please help me on understanding the "(s)-1" part, why's that? and also macros like: #define PAGE_ROUND_DOWN(x) (((ULONG_PTR)(x)) & (~(PAGE_SIZE-1))) #define PAGE_ROUND_UP(x) ( (((ULONG_PTR)(x)) + PAGE_SIZE-1) & (~(PAGE_SIZE-1)) ) I know the ...

How to disable macros in office word 2003?

I am trying to convert a word report to PDF using Adobe distiller. Some of these word files have macros in them which shows a popup when the doc is opened and this stops the automation process. We tried disabling the macros' by wordApplication.AutomationSecurity = Microsoft.Office.Core.MsoAutomationSecurity.msoAutomationSecurityForceDi...

compile different code on whether a function is available or not

Windows provides only GetTickCount up to Windows Vista and starting from that OS also GetTickCount64. How can I make a C program compile with calls to different functions? How can I make a C compiler check whether a function is declared in the included header files and compile different portions of code depending on whether that particu...

Macros On Toolbar - Office 2000

Hi, Someone at my office has an access database which includes macros in the toolbar. To access it currently they have to log out of the domain and into a local user account. They would like others in the office to be able to access the database, which they can, but they cannot use the macros on the toolbars. The office version that is...

Retrieving a c++ class name programatically

I was wondering if it is possible in C++ to retrieve the name of a class in string form without having to hardcode it into a variable or a getter. I'm aware that none of that information is actually used at runtime, therefor it is unavailable, but are there any macros that can be made to create this functionality? Thanks. Edit: May be h...