473,626 Members | 3,316 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Calling a macro from a excel sheet

1 New Member
I am trying to call a macro written in excel and calling from VBA code. Macro is in worksshet within a workbook.
Error message is : Object variable or with block variable not set
Any idea what it is complaining about?
May 22 '10 #1
1 1713
ADezii
8,834 Recognized Expert Expert
@canada18
Expand|Select|Wrap|Line Numbers
  1. Dim xlApp As Excel.Application
  2. Dim xlBook As Excel.Workbook
  3.  
  4. Set xlApp = New Excel.Application
  5. xlApp.Visible = True
  6. Set xlBook = xlApp.Workbooks.Open("C:\Test\Test.xls")
  7.  
  8. 'Run the macro
  9. xlApp.Run "Macro1"
  10.  
  11. 'Your choice
  12. 'xlApp.Quit
May 22 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
1227
by: sal21 | last post by:
is possible to run macro with an ASP page, example: \\server\mydir\mywbook.xls\mymacro() -- sal21 ------------------------------------------------------------------------ Posted via http://www.webservertalk.com
5
2694
by: Rajiv | last post by:
HI ALL, actually , i m working in a company having large number of employee , i have two userid and password . on id is from admin group(id given to me by technology manager) of the server and other is simpley the user . my software is based on Lan authentication based i.e. when a user works on my system i find that user using AUTH_USER , i think you will be getting my point . when i login using that admin id it creats the excel sheet...
4
1500
by: koobelek | last post by:
Here is what I'd like to do: I type in a query in MS Access form. The result is a list of names. I want to put those names in MS Excel Sheet. How do I do that? I'd appreciate any help. Thanks. Regards, koobel
3
2346
by: OhMyGaw | last post by:
Hello Excel/automation Gurus, I am working on an application where I have to keep a centralized database of all macros distributed to user and save the changes back on a nightly basis back to one central Excel macro repository. What would you guys suggest me do? Should I keep all macros in a centralized unique text file of some sort or is it best to do with SQL server?
14
5781
by: pmud | last post by:
Hi, I need to use an Excel Sheet in ASP.NET application so that the users can enter (copy, paste ) large number of rows in this Excel Sheet. Also, Whatever the USER ENETRS needs to go to the SQL DATABASE, probably by the click of a button. Is this possible? & what is the BEST APPROACH for doing this? & also if any links are there do tell those to me too coz I have no idea how to go about doing it.
5
5767
by: HDI | last post by:
Hi, How can I programmatically open a password protected excel-sheet? Thx
2
2438
by: vijayasankarb | last post by:
Hi All, I am developing one application in VBScript which automatically generates excel charts. But, I have a problem here. I need to get the range value(like A1:B50) before calling the Activechart.setSourcedata function..... In the below code I am asking the user to enter the range. But, It is not requiremnet, The user just gives the .xls file. We need to get the range of the data. Please give me the code which gets the range of an...
4
16091
by: shara | last post by:
Hello, I have a php script that outputs an excel sheet.The user has to download macro every time he wants to run the macro on the excel sheet. Is there anything in php where the code downloads macro also along with the excel sheet or something like a button in excel sheet itself, clicking on which the macro runs on the excel sheet. Any help is well appreciated. Thanks&Regards, Shara.
12
9040
by: forrestgump | last post by:
I am currently trying to create VBA to send a specified excel sheet to varied email sources. I currently have the code below which sends the attachment in an email to a specified source e.g. mrqwe@hotmails.com, however I want to change this so the address is chosen from a specified cell on a worksheet. I have tried to reference a cell e.g. .sendmail Sheets("sheet3").range("A1"),_ but this does not work. Any ideas anyone? Sub...
7
12060
by: TG | last post by:
hi! I am trying to create a sql server table from an excel sheet. Here is the code I have: 'This procedure the xlsx file and dumps it to a table in SQL Server
0
8272
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8713
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8370
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7206
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6126
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4094
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2632
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1817
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1516
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.