473,378 Members | 1,134 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Can I use VB to run a macro in any Microsoft application?

Can I use VB to run a macro in any Microsoft application?

My goal is to place the following in a macro: "Alt+tab, Alt+spacebar,
'M', left mouse click". This will allow me to switch mouse focus when
I switch applications.

The problem is that I've only made VBA scrips in Excel, and I don't
think that these VBA macros work outside of Excel. Can VB be used
outside of Excel? Is this something that can be done in .NET or
regular VB?

May 1 '06 #1
1 875
Using SendKeys like that is always a bad idea. You are "assuming" the window
has the focus, but you never really know. Automation is the way to go
"Neji" <ch********@yahoo.com> wrote in message
news:11**********************@i39g2000cwa.googlegr oups.com...
Can I use VB to run a macro in any Microsoft application?

My goal is to place the following in a macro: "Alt+tab, Alt+spacebar,
'M', left mouse click". This will allow me to switch mouse focus when
I switch applications.

The problem is that I've only made VBA scrips in Excel, and I don't
think that these VBA macros work outside of Excel. Can VB be used
outside of Excel? Is this something that can be done in .NET or
regular VB?

May 1 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: BenJamin | last post by:
Hi, I have been given the task of publishing a business process to the companies web portal. What I have to do is to publish an excel spreadsheet to a web page that has several buttons which run...
4
by: mvivar | last post by:
Hi everybody: This will be not easy to explain as my mother language is not english, so my apologies in advance if it sounds confusing. We have a database access 97 wich controls time of...
4
by: Rich Wallace | last post by:
Is there a way to open an Excel file and either respond to or supress the Macro warning window via VB.NET? Dim oExcel As Excel.Workbook Dim sFilePath As String = "C:\DailyReport.xls" oExcel...
5
by: Mason | last post by:
I'm having some problems converting VBA for Word 2000 to code that VB.Net understands. I recorded a macro in Word to add numbering (a. b. c.) to my paragraphs. I managed to translate quite a bit...
2
by: cr113 | last post by:
I just upgraded from Office 2000 to Office 2003. My VB.NET Excel macro calls don't work any longer. Here is how I make my Excel macro call from VB.NET: Dim objExcel as Excel.Application ...
3
by: Mr.Doubt | last post by:
I'm trying to run a Excel macro, which uses SOLVER.XLA Add-In, in VB.NET application. When the macro is executed I get the following error message "Solver: An unexpected internal error occured,...
1
by: cr113 | last post by:
We've upgraded from Office 2000 to Office 2003 and now my excel macro calls are messed up. There's about a 15 second delay from the time I make the call in VB.NET to the time the excel macro is...
2
by: Senthil | last post by:
Hi All I need to create an Excel report and create a command button and have to run a macro on the click event that will print all the pages in the Excel workbook. I am able to create the report...
0
by: =?Utf-8?B?TGV0emRvXzF0?= | last post by:
I'd like to create a Macro that will sort some raw data, apprx 20k lines, remove some lines based upon a condition in a certain column. Then copy this data into a new spreadsheet and sort the ...
1
by: arun0580 | last post by:
I am running a VBA macro application in Microsoft Excel 97 under Windows XP -Service Pack 1 to, 1.Open an Excel work book . 2.Update a value in a cell 3.Save and close the file. I need to...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.