vba

How do I call WCF client from Excel 2003 VBA?

Hi There, As the question asked, how do I call WCF client from Excel 2003 VBA? I saw there is a place where I can call web service, but I have searched through Google, all the results I get is not possible to call a WCF client from VBA. I would like to know sort of what method to use before I do anything with my code, don't want to wa...

Excel 2003/VBA: How do I know if an object is already referenced?

In some VBA attached to an Excel 2003 spreadsheet I need to make use of some objects that take a while to instantiate - so I only want to do the 'set' thing once... It's easier the show the code than to write an explanation! ' Declare the expensive object as global to this sheet Dim myObj As SomeBigExpensiveObject Private Sub CommandB...

Unicode string to flat file from vba

I want to store a unicode string in a flat file on a windows box from an excel/vba macro. The macro converts normal string to unicode representation, need to store it in a file and retrieve later. ...

Hiding Page Breaks in Excel

Following on from my previous questions: I have implemented a series of checkboxes with which users can hide/unhide ranges of data. This is great - it works. The problem is when the users go to print - the hidden data is hidden but the pages are still there but blank. If the page breaks are left to their own devices then everything is...

How to get/set unique id for cell in Excel via VBA

I want to have/define a unique id for each data row in my Excel data sheet - such that I can use it when passing the data onwards and it stays the same when rows are added/deleted above it. My thoughts are to use the ID attribute of Range (msdn link) So, I have a user defined function (UDF) which I place in each row that gets/sets the ...

DoCmd.SendObject fails when IIS Admin Tools is installed.

I have an application that is written in VBA inside of Microsoft Access 2003. We have a form that allows the users to send an automated email message to the development team that uses the following code: DoCmd.SendObject acSendNoObject, , , _ "[email protected]", "", "", _ "Helpdesk Submission", msg, False, "" This code was wo...

VBA for Inserting a chart into a ppt slide

Below is a procedure that I use to pull charts into a ppt from excel spreadsheets. However one thing I cannot figure out is how to insert the picture into the "object" instead of just pasting it onto th screen. (ie if I did a ppLayoutFourObjects, and sent fours charts to this slide, before adding another, I need to know how to paste the ...

Is there a difference in VBA versions between office 2003 and 2007?

Can I use access 2007 VBA references with impunity (specifically, as far as the base language and old com interfaces are concerned) to develop VBA based solutions for access 2003? Or is there some new/modified syntax added to the language that i need to be aware of? Has the object model been enhanced drastically in office 2007? An...

Can't apply 3d properties to autoshape

The workbook I am working on in Excel uses graphics with 3d properties which are set in VBA. I just changed an image in the workbook, and now Excel complains that it can't execute any of the following lines of code: Selection.ShapeRange.ThreeD.Depth = fsdoord Selection.ShapeRange.ThreeD.ExtrusionColor.RGB = carcol Selection.ShapeRange....

Best way to distribute Excel spreadsheet with VBA

I am trying to find out how to distribute an excel file on the net in such a way that most users will be able to use it. I am aware of the Microsoft Excel Viewer (which can open Excel files without having Office installed), but it doesn't run VBA code, which is a necessity for this file. Moreover, there are some changes to the API in O...

Parse Tab Seperated Values in VBA

I am trying to take clipboard data copied from excel (i.e. tab seperated text) and parse it into a Collection of Dictionaries. The idea is that each row will be represented by a Dictionary which maps from headers to cell values. The first row in the copied data will contain the headers. Getting the text from the clipboard is easy enoug...

Print Embedded pdf from Excel worksheet

Hi, I have a pdf file embedded in an excel worksheet that is opened through and icon. This icon object will have a specific name (i.e., "ObectToPrint"). What I need to do is print this pdf file without actually opening it. Is this possible? Thanks! ...

Strange "Argument not optional" error in VBA

Private Sub importClipboard_Click() Dim data As Collection data = getClipboardData() ...do something... End Sub Function getClipboardData() As Collection ...do something... End Function I am getting an "Argument not optional" compile error on the line: data = getClipboardData() What am I doing wrong? There no ar...

How can I pass variable parameters into a Javascript Function using Excel VBA

Hi, I'm not sure if I have the correct terms above, but what I'm trying to do is call a Javascript function passing parameters into it from an Excel File, so the function will run and list the items in the next textbox, allowing me to choose the correct entry in that textbox, which then chooses the final box. Here is the code that I hav...

Outlook 2003/VBA Movin E-Mails without changing the date

Hi. I use a macro in outlook 2003 to move selected emails to a specific folder. The moving works, but unfortunately the received date is overwritten to the current time. Any idea on how to prevent this. I use this code: Sub verschiebenInOrdner() On Error Resume Next Dim objFolder As Outlook.MAPIFolder, objInbox As Outlook.MAPIFo...

Managed Code AddIn for Access 2003

Hi, I have created a Managed Code AddIn for Access 2003 using Visual Basic 2008 (VS Professional) and it works fine on my development machine. It was created using the Shared Add-in template. I used the set up project to install... and the .Net Framework was installed. However when I try to deploy to another PC I get the following er...

VBA Error Handling

I am relatively new to VBA (Java/Python are more my thing, along with Haskell). One thing that has shocked and surprised me about VBA is the lack of any "obvious" way to do proper structured error handling. What are some good patterns for error handling in VBA? In particular, what should I do in this situation: ... some code ... ... s...

What does the Excel VBA range.Rows property really do?

OK, I am finishing up an add-on project for a legacy Excel-VBA application, and I have once again run up against the conundrum of the mysterious range.Rows(?) and worksheet.Rows properties. Does anyone know what these properties really do and what they are supposed to provide to me? (note: all of this probably applies to the correspond...

How to make Excel VBA Automation Execute for All End Users

Hello: I wrote the following code so that when an Excel spreadsheet is closed it will update its name with the current date and time: Private Sub Workbook_BeforeClose(Cancel As Boolean) If ThisWorkbook.Name = "Name_Last Opened-" & Format(Date, "MM-DD-YYYY") & _ "_" & Format(Time, "HH.MM") & ".xls" Then Else ThisW...

Appending html files in VBA

I have an Excel report with a bunch of sheets, each with a table of data. I need to make a button that will create one html page containing the tables, one after the other. I don't know much about html, so my first approach was to have a macro that creates another worksheet with the tables on it, and then saves that sheet as html using...