Question about Microsoft Excel for PC

1 Answer

Macros How do I close a workbook with macros in excel but leave the program ( excel ) open

Posted by on

  • Anonymous Feb 19, 2009

    I want to create a macro which will copy data from IBM Mainframe and paste in excel. There are few actions to be performed on Mainframe like functions assigned to function keys which also should be tapped in the macro. I have heard that there needs to be an interface or connectivity between excel and Mainframe but I do not know how to write a code for this connectivity. Please help.

×

1 Answer

  • Level 2:

    An expert who has achieved level 2 by getting 100 points

    MVP:

    An expert that gotĀ 5 achievements.

    Governor:

    An expert whose answer gotĀ voted for 20 times.

    Hot-Shot:

    An expert who has answered 20 questions.

  • Expert
  • 67 Answers

After you record your macro do the following.
Open the excel file contains the macro. Go to tools and go to macro and click on macros. Select the macro you wish to add the close operation. Click on Step into... This will open up the visual basic editor. In the code window, at the bottom row you will see End Sub. Right before that row, type workbooks.close
Save the macro by clicking the save button. And you can run your macro to see if it works. I tried, it does :) Good Luck :)

Posted on Feb 24, 2009

Add Your Answer

Uploading: 0%

my-video-file.mp4

Complete. Click "Add" to insert your video. Add

×

Loading...
Loading...

Related Questions:

1 Answer

I am using microsoft excel 2007, the code is not running, the macro was disabled.. How to enable the macro...?


From the excel help file

  1. Click the Microsoft Office Button o12filemenubutton_za10077102.gif, and then click Excel Options.
  2. Click Trust Center, click Trust Center Settings, and then click Macro Settings.
  3. Click the options that you want:
    • Disable all macros without notification Click this option if you don't trust macros. All macros in documents and security alerts about macros are disabled. If there are documents with unsigned macros that you do trust, you can put those documents into a trusted location. Documents in trusted locations are allowed to run without being checked by the Trust Center security system.
    • Disable all macros with notification This is the default setting. Click this option if you want macros to be disabled, but you want to get security alerts if there are macros present. This way, you can choose when to enable those macros on a case by case basis.
    • Disable all macros except digitally signed macros This setting is the same as the Disable all macros with notification option, except that if the macro is digitally signed by a trusted publisher, the macro can run if you have already trusted the publisher. If you have not trusted the publisher, you are notified. That way, you can choose to enable those signed macros or trust the publisher. All unsigned macros are disabled without notification.
    • Enable all macros (not recommended, potentially dangerous code can run) Click this option to allow all macros to run. This setting makes your computer vulnerable to potentially malicious code and is not recommended.
    • Trust access to the VBA project object model This setting is for developers and is used to deliberately lock out or allow programmatic access to the VBA object model from any Automation client. In other words, it provides a security option for code that is written to automate an Office program and programmatically manipulate the Microsoft Visual Basic for Applications (VBA) environment and object model. This is a per user and per application setting, and denies access by default. This security option makes it more difficult for unauthorized programs to build "self-replicating" code that can harm end-user systems. For any Automation client to be able to access the VBA object model programmatically, the user running the code must explicitly grant access. To turn on access, select the check box.

Jun 21, 2011 | Microsoft Office Professional 2007 Full...

2 Answers

Whenever I open a new spreadsheet now it automatically opens up a spreadsheet calles PERSONAL. Why is that and how can I get rid of it... I think it started after a did a macro but I am not sure. Thanks,...


You're right - it was caused by recording a macro. When you record a macro you are given the option to store the new macro in "This Workbook", a "New Workbook" (the default), or in a "Personal Macro Workbook". It looks like you selected "Personal Macro Workbook".
The recorded macro is stored in a special workbook called "Personal.xls". This workbook is loaded every time Excel is loaded. If you don't want this workbook loaded, then just delete it or rename it.
The file is buried deep in Microsoft's application data area. On my Vista computer it's in C:\Users\frogfund\AppData\Roaming\Microsoft\Excel\XLSTART On my Windows XP computer it's in C:\Documents and Settings\frogfund\Application Data\Microsoft\Excel\XLSTART. Depending on your computer your Personal.xls might be in a slightly different location. You might need to do a search using Windows Explorer.
If you are still having troubles finding personal.xls 1. Open Excel, 2. Open the Visual Basic editor (hit Alt-F11 or click Tools-Macro-Visual Basic Editor) 3. Click Tools-References to bring up the references dialog 4. Click on VBAProject in the list. The file location will be displayed near the bottom of the dialog box. Sometimes this might be cut off at the end, but it should give you a good idea where the file is located. 5. Click Cancel to close the dialog.

Sep 23, 2009 | Microsoft Office Excel 2003 for PC

1 Answer

Same problem - excel files balllooning from 20Kb to 45Mb


This could happen if your workbook is being shared.
1. Make a backup copy of your workbook (Excel file).
2. Open it in Excel
3. Check under Tools > Share Workbook and see if the "Allow changes by more than one user..." option is selected. If so, try unchecking it and save the workbook
4. Check the file size under File > Properties > General tab


Another possibility is that there are a lot of unused cells with "invisible" formatting. To check that you can try pressing Ctrl+End and see where the end of your document is. If it is way beyond your current work area, select those extra columns and rows and go to Edit > Clear > All (Note: This will delete everything on those cells)


Aug 19, 2009 | Microsoft Office Excel 2003 for PC

2 Answers

Using Macros in Excel sheet Requires Programing.. or it can be done, as we do Vlookup and other formulas


Creating Macros does not require programming. The only suggestion I would make if you are new to macros - break down your task to very small sub tasks, in order to avoid confusion.

Jun 09, 2009 | Microsoft Excel for PC

1 Answer

Macro


Hi motilal

Follow these steps to create multiple macros

Click the Microsoft Office Button , and then click Excel Options.
In the Popular category, under Top options for working with Excel, select the Show Developer tab in the Ribbon check box, and then click OK.

Note The Ribbon is a component of the Microsoft Office Fluent user interface.
To set the security level temporarily to enable all macros, do the following: On the Developer tab, in the Code group, click Macro Security.


In the Macros Settings category, under Macro Settings, click Enable all macros (not recommended, potentially dangerous code can run), and then click OK.

Note To help prevent potentially dangerous code from running, we recommend that you return to any of the settings that disable all macros after you finish working with macros.
Open the workbook that contains the module that you want to copy and the workbook that you want to copy the module to.
On the Developer tab, in the Code group, click Visual Basic.
On the View menu, click Project Explorer .
Drag the module that you want to copy to the destination workbook.

Regards,
TheAssembler

May 06, 2008 | Microsoft Excel for PC

1 Answer

Macros Help PLZ


Change the file ending back to .xls, open the file, enable macros, then try renaming the file to the new extension.

Mar 14, 2008 | Microsoft Excel for PC

1 Answer

Macro on excel


Macros are a timesaving feature that allow you to record a sequence of actions that you do in excel, and replay them back later.

You give each macro a name, and you can invoke them later, and Excel will "do" whatever it is you did when you recorded the macro.

To record a new macro:
1) Open Excel
2) Go to Tools->Macros->Record New Macro...
3) Type in a name for your macro and hit OK

(A new toolbar will popup with a "stop" button on it. Excel is now recording everything you do)

4) Do something, like, for example, select some cells and make them bold.
5) Click the "stop" button.


Now your macro has been recorded! You can play it back later by:

1) Open Excel
2) Go to Tools->Macros->Macros...
3) Select your macro from the list
4) Click "Run"

The actions you performed earlier will now be executed.



-------


Macros are written in Visual Basic for Applications, or "VBA". It is a programming language which uses the Excel Object Model to perform various actions. You can edit and create custom macros by writing the code manually in VBA. To do this:

1) Open Excel
2) Go to tools->macros->macros...
3) Select an already existing macro
4) Click "Edit"

(The visual basic editor will open, showing you the code for your macro)

At this point you are writing a program in Visual Basic. To learn how to edit macros, you need to learn visual basic, as well as the specific quirks related to excel macros in visual basic.

Recording a macro, and then using it as a template while you edit it is a common trick for making macros manually more quickly.

If you are not familiar with VB, I would not suggest attempting to edit your macros in any but the most simplest of ways. If you're brave, you can try to learn about editing macros in VBA here:

http://www.anthony-vba.kefra.com/

Jan 28, 2008 | Business & Productivity Software

1 Answer

EXCEL


I have solution for your second problem.
You just need to use macros to protect all the sheet at the same time. Just open "Macro>Record new Macro" to insert new macros to your files.

This will save some your valuable time.

Jan 09, 2008 | Business & Productivity Software

2 Answers

Need to Know fully info about Macros


Macro is a simple way to automate tasks in Microsoft Office programs. It allows advanced users to program or create their own commands in Office, thereby automating tasks. For example, a user might want to create a table with four values already in them. The user could create one, and then copy it, and paste it. However, when you restart your computer, that data is lost. Unless you open the old document and copy the table, you'll have to start all over again. Macros helps you do your tasks. By recording the table creation to a macro, creating the same table over and over is just a simple macro away.

Sep 26, 2007 | Microsoft Office Standard for PC

1 Answer

Excel Macro


Try these links you could find out

http://www.vbaexpress.com/kb/getarticle.php?kb_id=706
http://www.computing.net/programming/wwwboard/forum/5902.html

Sep 23, 2007 | Microsoft Excel for PC

Not finding what you are looking for?
Microsoft Excel for PC Logo

Related Topics:

176 people viewed this question

Ask a Question

Usually answered in minutes!

Top Microsoft Business & Productivity Software Experts

Brian Sullivan
Brian Sullivan

Level 3 Expert

27725 Answers

Les Dickinson
Les Dickinson

Level 3 Expert

18298 Answers

Sudeep Chatterjee
Sudeep Chatterjee

Level 3 Expert

3267 Answers

Are you a Microsoft Business and Productivity Software Expert? Answer questions, earn points and help others

Answer questions

Manuals & User Guides

Loading...