vba

Extracting Macros in a Word Document to a text file from c#

Hi, I need to extract all VBA code from a Word 2007 document in c# without using office automation. What I have done so far is to open the Word document as a structured storage file in c#, and I receive a list of the following streams: Macros VBA dir ( stream ) Module1 ( stream ) ThisDocument ( stream ) _VBA_PROJECT...

Excel VBA Macro, Exclude/Include specific lines in HTML export macro.

Hi there, Backstory: I've been building a back-end CMS/database for a client to manage his bar's ever changing drink menu, however the CMS/database will no be ready for use for a while, and thus I also need a temporary solution to help update the website's menu. Situation: The client prints the bar's menus daily from a formated Excel...

Help me optimize VBA Excel code for copying certain columns of every row on a sheet to another.

Hi all, I need to copy certain columns of every row in sheet A into sheet B. I have created a sub that creates 2 arrays (variants) of the matching column numbers, so I can map column 3 in sheet A to be equal to column 8 in sheet B, etc. Everything works fine, thing is it's quite slow, here it is: Sub insertIntoSelectedOpps(opCols As...

Excel 2003 VBA: Move a sheet into a new workbook that is referenced by a variable

Hi I have a function that is meant to run the ShowPages() command of a PivotTable and then save each sheet to a separate file. Here's how I wish I could do it: Sub Split() ThisWorkbook.Sheets("Data").PivotTables("Data").ShowPages PageField:="Codename" Dim newWb As Workbook For Each s In ThisWorkbook.Sheets If s.Na...

how to insert excel data in a database with java

hi, i want to insert data from an excel file into a local database in a UNIX server with java without any manipulation of data. 1- someone told me that i've to convert the excel file extension into .csv to conform with unix. i created a CSV file for each sheet (i've 12) with a macro. the problem is it changed the date format from DD-...

Efficiently assign cell properties from an Excel Range to an array in VBA / VB.NET

In VBA / VB.NET you can assign Excel range values to an array for faster access / manipulation. Is there a way to efficiently assign other cell properties (e.g., top, left, width, height) to an array? I.e., I'd like to do something like: Dim cellTops As Variant : cellTops = Application.ActiveSheet.UsedRange.Top The code is part of a ...

vba: multi-dimensional arrays REDIM

i have an array: Dim qcNo(4, 2, 350) As String the problem i have is that sometimes there is a requirement for the matrix to be bigger. i need the 350 to sometimes go to 1000. is it possible to do a redim preserve on a 3 dimensional array? if so, how would i do it? ...

access 2007 bug - intermittent query parameter prompts

I am working on an Access 2007 application that was created by someone else. It has a strange, intermittent bug in which it prompts the user for query parameters when the main form is opened. The query parameters are clearly not necessary, because the error does not always occur. The very strange "fix" to this problem is to open and clo...

automating decompile / recompile in ms-access

my front end from time to time is getting larger. i am building new reports and forms. i know that remou suggests to decompile and compile every so often to make sure nothing is corrupt. can i automate this decompile/ recompile process? ...

Is it bad practice to access a data member directly?

I recall being told by a professor the following is bad practice. But it makes stepping through code a lot less tedious. I'm just solicting comments on pros and cons: Friend Class MyClass Private isEmpty As Boolean Public Property IsEmpty() As Boolean Get Return isEmpty End Get Set(ByVal Value As Integer) isEmpty = value ...

getting started with processing data with python

i have an excel spreadsheet of about 3 million cells. i asked the following question and i liked the answer about saving the spreadsheet as CSV and then processing it with python: http://stackoverflow.com/questions/3322939/solution-to-perform-lots-of-calculations-on-3-million-data-points-and-make-charts/3323168#3323168 is there a libr...

smallest learning curve language to work with CSV files

VBA is not cutting it for me anymore. i have lots of huge excel files to which i need to make lots of calculations and break them down into other excel/csv files. i need a language that i can pick up within the next couple of days to do what i need because it is kind of an emergency. i have been suggested python, but i would like to che...

How to create an ADODB Recordset From a Table Valued Function with Named Parameters

This works: Dim rst As New ADODB.Recordset rst.Open "SELECT * FROM dbo.ftblTest(1,2,3)", CP.Connection, adOpenKeyset, adLockReadOnly But it would be nicer to do this: rst.Open "SELECT * FROM dbo.ftblTest(@Param1=1,@Param2=2,@Param3=3)", CP.Connection, adOpenKeyset, adLockReadOnly If I try the second method I get the error: "paramet...

use vba creat csv but the format of csv is not correct.

I use the code as below. Private Sub CommandButton1_Click() Const File$ = "C:\CsvfileTest2.csv" Dim Fso, MyFile Set Fso = CreateObject("Scripting.FileSystemObject") Set MyFile = Fso.CreateTextFile(File, True) MyFile.Close With CreateObject("ADODB.Stream") .Open .LoadFromFile File .Pos...

Word vba - How can I store string values in a module?

Hi, the title may not be appropriate because I don't really know how I should put this. I have a template where I have a "Module1" module and a "ThisDocument" code. Module1 contains the following code to pick up values from the registry. I pick up these values from ThisDocument code. What I want is to move the code from ThisDocument ov...

MS Access 2010 Get column names

Hi guys, I need to get all of the column names of a table using vba or Access SQL and iterate through them for validation, does anyone have a solution to this, I have searched google to no avail. Any help much apriciated :) ...

Passing Form Objects to VBA Subs/Functions in MS-Access

I have a little multiple choice application. There are 4 green check marks and 4 red x's that will come up based on the right answer or the wrong answer. They are all not-visible initially and are in specific places on the form so that when they become visible, it'll be like a green check mark if they get it right next to their answer ...

Calling GetGUIThreadInfo from Outlook VBA

I'm writing a VBA Macro in MS Outlook that needs to find the active window in a particular process. The goal of this is to get the name of the active window/document, even if its parent application has a multiple document interface. To get the active process, I'm using GetGUIThreadInfo along with GetCurrentThreadId from user32.dll. Here...

how to check if table is exists or not in ms access for vb macros?

Hi friends, i am new to vba macros. Any idea to check the table if it is exists or not? I check with previous post and idea, but not got clear solution for this. Please provide your idea. Thanks in Advance Friends. ...

Read INI values only once in Word VBA

I've trying to simplify a script and it's routines and I'm not quite sure what's the best way of doing it. I want to repeat code as little as possible. So below is my current code. This is the Filename function that basically checks if an ini-file exists. It should probably just run once. The way it's now, it's run everytime the string ...