macros

Where are all the places that VBA macros for Excel 2007 can be turned off?

Macros refuse to run for me in Excel 2007 on Windows Server 2003. The macro and visual basic icons on the ribbon are grayed out. If I open a workbook with a macro, I get the warning: " This workbook has lost its VBA project, ActiveX controls and any other programmability-related features." If I try to make a new excel template in VSTO (E...

C# Macro definitions in Preprocessor

Hi! Is C# able to define Macros like in C with Preprocessor statements to ease regular typing of certain repeating statements like Console.WriteLine("foo"); ? I didn't find a solution. Thanks! ...

Macro questions

On a software project (some old C compiler) we have a lot of variables which have to be saved normal and inverted. Has somebody a idea how i can make a macro like that? SET(SomeVariable, 137); which will execute SomeVariable = 137; SomeVariable_inverse = ~137; Edit: The best Solution seems to be: #define SET(var,value) do { var...

VBA: How do you prevent a QueryTable from refreshing?

I wrote a macro that imports a CSV file into my spreadsheet, using a QueryTable. My goal is to import the CSV data and be able to save it in the spreadsheet for future reference. However, the QueryTable updates with the external CSV file, of course, and I would like to prevent this (because I want to forget about the external file). ...

Is there a way to get function name inside a C++ function?

I want to implement a function tracer, which would trace how much time a function is taking to execute. I have following class for the same:- class FuncTracer { public: FuncTracer(LPCTSTR strFuncName_in) { m_strFuncName[0] = _T('\0'); if( strFuncName_in || _T('\0') != strFuncName_in[0]) { _...

How Do You Dynamically Graph/Chart Interval Data w/ OpenOffice Calc?

I'm interested in creating one or more spreadsheet graphs of interval metered data. The raw data is recorded as a continuously increasing value (i.e. total bytes, user logins, website hits) and date. Each sample measurement date will happen at a non-constant interval. For simplicity I would like to record the data in a spreadsheet progra...

Emacs: getting readable keyboard-macros

When using insert-kbd-macro to save a named keyboard-macro I get "unreadable" lisp-code like (fset 'ppsql (lambda (&optional arg) "Keyboard macro." (interactive "p") (kmacro-exec-ring-item (quote ([134217788 134217765 44 return 44 17 10 return 33 134217765 102 102 backspace 114 111 109 return 17 10 102 111 109 backspace backspace 114...

c++ #define a macro with brackets?

Hi, Instead of doing the following everytime start(); // some code here stop(); I would like to define some sort of macro which makes it possible to write like: startstop() { //code here } Is it possible in C++? ...

Python Macros: Use Cases?

If Python had a macro facility similar to Lisp/Scheme (something like MetaPython), how would you use it? If you are a Lisp/Scheme programmer, what sorts of things do you use macros for (other than things that have a clear syntactic parallel in Python such as a while loop)? ...

Using Visual Studio macro names to launch external applications doesn't work?

Using Visual Studio / C#, I've been debugging some nunit tests recently, and am now trying to make sure that if we branch the code that the unit tests don't stop working in debug mode. I have this working by changing project properties to launch NUnit as an external program: C:\Program Files\NUnit 2.4.8\bin\nunit-console.exe ..and th...

How do you share Macros between Visual Studio 2008 Workspaces?

Kind of a newbie VS question : I'm not certain it's called a workspace in VS, but when I log in as a different user on my PC, I notice that VS acts as it is in another 'workspace' (cf. Eclipse) The custom codesnippets are managed seperately for example, and also the Macro's I write under one useraccount are not available under another ...

Copy data from one sheet to other, on selection of data from the dropdown list.

Hi, Please help me in writing the Macro.I have no idea writing VB Macro and its SyntaX. The scenario is: An excel document has two sheets.The first sheet contains the marks,grades and project details of students. The second sheet contains the dropdown lists of Project version number, different Company names, and post. Project version...

Excel Macros - How do I get Range of AutoFiltered rows?

OK, so I have set AutoFilter property for the whole of the active worksheet (UsedRange.AutoFilter Field:=1, Criteria1:= [blah blah]) Once the filter is applied, how do I programmatically select the range if rows and columns that are the result of the filter. I checked UsedRange, but that gives the whole (unfiltered) range. Any ideas? ...

Word Macro - Insert picture as oShape?

Hi, I'm trying to write a macro where I press a button and a dialog window appear which lets me choose an image I want to insert to the document. I've managed to do this by this simple code: Private Sub btnInsertPicture_Click() Dialogs(wdDialogInsertPicture).Show For Each ishape In ActiveDocument.InlineShapes With ishape ...

Adding Code to a Command Button that was dynamically added to a frame in a user code

Hi, This is a vba question. I found the question: "Adding controls to a frame in an Excel userform with VBA" and used its method to add commandbuttons to my frame in my user form. Since I added four commandbuttons, I ran the code in a loop, and used the With ... .Name = "commandbutton" & x to give each command button its own ...

nmake - simple question about escaping

Hi I'd like to make below nmake code to produce check.mak file with the following contents: $(A) instead I get the following error: "NMAKE : fatal error U1040: internal error : macro expansion" Any suggestions? My nmake version is 9.00.30729.01 (VC 2008). OPTION = A FILE = check.mak all : @echo "$$($(OPTION))" > $(FILE) ...

Is there an Emacs Lisp library for generating HTML?

I'm looking for a solution that allows me to write native Emacs Lisp code and at compile time turns it into HTML, like Franz's htmlgen: (html ((:div class "post") (:h1 "Title") (:p "Hello, World!"))) Of course I can write my own macros, but I'm interested if there are any projects around this problem. ...

C Macros to create strings

I would like to use C #define to build literal strings at compile time. The string are domains that change for debug, release etc. I would like to some some thing like this: #ifdef __TESTING #define IV_DOMAIN domain.org //in house testing #elif __LIVE_TESTING #define IV_DOMAIN test.domain.com //live testing servers #else ...

nmake - how to forward macros between nmake invocations?

Hi How can I forward macros between nmake invocations? Let's say we have --- a.mak --- some_variable = value all: nmake -f b.mak --- END --- --- b.mak --- all: @echo some_variable = WHAT TO PUT HERE TO GET VALUE OF some_variable? --- END --- I was trying different things like using set and setx commands but value of vari...

How can I forward macros between nmake invocations from callee to caller?

How can I forward macros between nmake invocations from callee to caller? It's the reverse of what I was asking here: nmake - how to forward macros between nmake invocations? ...