Force Calculation Upon Saving Workbook

Aug 2, 2006

I have this workbook that has around 12-15 worksheets. At present there is a formula that takes a arugument called "Calc". now it is set to automatic recalculate in the prefereneces. so whenever i change a sheet i have to then go to another sheet to where the calc field resides and just change the number to any number other then zero and immediately it calculates all the sheets in the workbook.

So now,I want to recalculate only one sheet at a time instead of all the sheets and also dont want to depend on the calc field of another sheet. So i made the preferences to manual and checked the box that says 'recalculte on save'. and also in the function gets () im replacling the calc to '6'. And for each sheet in vba- i wrote:

Private Sub Worksheet_Change(ByVal Target As Excel. Range)
ActiveSheet.Calculate
End Sub

But when i do alt+s to save it just saves but does not recalculate. how do i make it recalculate when it saves..

View 2 Replies


ADVERTISEMENT

Run VBA Macros In Specific Order, Turn Off Calculations & Force Calculation Of Range

Apr 22, 2009

I have a VBA method that goes thru and calculates a bunch of stuff and puts this calculated info into a static data structure. This method is called 'setProjectInfo()'. This method is reliant on values on my worksheets, So as the user makes changes to the worksheet, I want setProjectInfo() to get called so it refreshes the data structure with updated information. I then have a bunch of helper methods to access different parts of this data structure. These helper methods are used in the formulae of a bunch of cells on a worksheet (ie '=getPercentComplete(period)', etc, etc).

This is all working well except for one thing. Sometimes the helper methods get called BEFORE setProjectInfo() gets called.. So, the helper methods return stale information. I can only get around this by manually recalculating the spreadsheet again. setProjectInfo() does enough stuff and takes a long enough time that I don't want to have to call it at the top of each helper method.

I've put the call to setProjectInfo() in a cell formula at the top of the my spreadsheet in hopes that Excel would know enough to call it first.. But that does not seem to work. Net, how can I get VBA to always call setProjectInfo() BEFORE it calls any other VBA methods?

View 3 Replies View Related

Creating New Workbook / Copying Sheets And Saving Workbook - Subscript Error

May 30, 2014

Trying to create a new workbook from another open workbook, then copying all the sheets that aren't called "Summary" to that new open workbook and then saving it. I get a subscript error on this line:

[Code]....

View 3 Replies View Related

Force Workbook Open New Instance

Dec 14, 2006

I've created a UserForm which the user exclusively uses to interact with a workbook.

The problem is, if the user opens another workbook, it will open in the same Excel "Process" or "Instance" and the user would have to close the UserForm in order to use the other workbook they opened.

In VBA or some obscure application setting, is there a way to force workbooks to open in a new Excel Process (or new "Instance" of Excel)?

Another possibility would be to code something in the UserForm workbook that, on Workbook Open, would start a new separate Excel process....if that's even possible (can VBA execute a system shortcut or system command string?).

View 3 Replies View Related

Force Specific Workbook Only To Fullscreen

Apr 23, 2008

I have an auto_open macro in my workbook that sets the workbook to FullScreen. However, it also makes existing open workbooks fullscreen. Is there some way that I can leave the previously open workbooks not fullscreen (i.e. so the toolbars are still visible)?

View 3 Replies View Related

Extracting Information From A Workbook And Saving Into A Separate Workbook

Feb 21, 2014

i have a workbook blank template for my colleagues to fill in, they fill in this blank template and save it under the serial number of the item they are creating. However a lot of errors exist when they input the serial number inside the workbook where the serial number is a duplicate of a former serial number.

Anyhow i was wondering is there any way when they input the serial number into the worksheet that i could get it to save in a separate workbook and then have conditional formatting to check those serial numbers in the workbook to see if they match?

View 4 Replies View Related

Force Specified Sheet To Display When Workbook Opens

Jun 11, 2013

I need to set the "Sheet1" to be the sheet that always displays first, regardless of what sheet was active when last saved.

The reason is that I have a sheet with instructions on it as how to use the Workbook, including "You must Enable Macros" etc. When Macros are enabled, it's all good, as most people use a USERFORM which I have coded to set "Sheet1".Select and save their work upon closing using the USERFORM.

BUT when the advanced users modify other Sheets directly without using the USERFORM, and "SAVE" and then "Close" , the next time a user opens the Workbook (If they do not enable Macros) it opens to the sheet the advanced user Saved on. Thus killing my instructions page and putting the exact people I did not want messing around on certain sheets, on those sheets, fully bypassing the USERFORM created to avoid the problem.

I can force the workbook to switch to "Sheet1" and Save and Close, every time someone closes or EXITs, BUT I quickly realized when testing that any mistakes made are then permanent because you cant EXIT without Saving.

So. Is there a setting somewhere (Not Requiring Enabled Macros) to force a Workbook to ALWAYS open "Sheet1" first, regardless of what Sheet was last saved in the Workbook?

View 8 Replies View Related

Force Macros Enabled On Workbook Open?

Oct 28, 2013

I'm posting a workbook on our network that I want to enable users to go in and update. I have the workbook designed, with entry fields for the data they need to enter, and they then push "Submit" to submit the new data to a hidden tracking log within the workbook.

Many of the users will be complete Excel newbies, and although I haven't posted the workbook yet, I am trying to anticipate possible issues. The first that comes to mind is that the user opening the workbook may not have macros enabled in their version of Excel, and they will get a message, and can't perform the udpate. Is there a way to add a Workbook Open event that automatically enable macros in the workbook when they open it, even if it is for this workbook only?

View 5 Replies View Related

Force Single Instance Of Excel When Opening New Workbook From Email?

Aug 28, 2013

I have multiple buyers that use an Excel workbook containing several macros to perform edits on other workbooks they receive via email. Generally, they have the workbook containing the macros open, and they can double-click the workbooks they receive in the email messages to open them, and the macros are available from the "master" workbook.

Recently, however, some of the buyers have been getting new computers running Windows 8 and Office 10. Now when they have the "master" workbook open, and double-click the attached workbook in an email, (Outlook 10), the new workbook opens in a new instance of Excel, and as a result the macros are not available to run on the newly opened workbook.

The work around has been to right-click the attachment and save it to their desktop, and then use the File/Open command from the "master" to open the new file. This is a hassle and takes extra time.

I'm sure I am overlooking a setting somewhere that tells Excel to always open new workbooks using the same instance of Excel, (there are two people using the new systems that aren't having problems, and two that are), but for the life of me I can't find where to set these parameters.

View 6 Replies View Related

Force Links To Reference Linked Workbook Network Folder

Apr 4, 2008

The situation is that I have created a workbook in a network folder: xprojectsexcelclientAApril
umbers

The workbook links to a few other workbooks on the same network, but in the parent folder: xprojectsexcelclientAApril

The problem occurs when my colleagues have to updates the links in the main workbook, because they have not mapped the network drive in the same way as I have. The problem is NOT the prefix, but the fact that they have a more direct link to the network folder. My collages have mapped the folder like: xclientAApril
Is there a way where I can make the links in the workbook, so they don't depend on the entire string, but only on the fact that it is in the parent folder?

View 3 Replies View Related

Saving A Workbook Via The This Workbook Module

Mar 20, 2007

I will shortly be running a project over a twenty four hour period, where a group of people will be inputting data into a workbook (one worksheet per hour), and what I would like to know is if it is possible, to input some coding into a thisWorkbook module to action a save on the workbook every time an entry is placed in column A (of each worksheet) which is divisable by 10 (a10, a20, a30 etc).

View 2 Replies View Related

Saving Just One Tab Out Of A Workbook

Dec 4, 2008

I have an Excel doc with ~20 tabs. Each type represents 1 type of activities (soccer, tennis, etc). The size of the file (with the 20 tabs) is pretty significant (>1mb), which jams our email traffic.

Is it possible to:
- keep this workbook with the 20 tabs when open by the user;
- let the user select and fill in whatever tab he needs (just one at a time);
- have a button for the user to click that will save only this tab with a different filename (therefore, when sent by email, the file should be pretty small).

View 9 Replies View Related

Closing Workbook With VBA Without SAVING?

Nov 27, 2012

I'm trying to close a workbook without saving it. But everytime I get the message box popupped twice.

These are the codes that I use:

VB:
Private Sub Workbook_BeforeClose _(Cancel As Boolean)
Dim YesOrNoAnswerToMessageBox As String
Dim QuestionToMessageBox As String

[Code].....

View 4 Replies View Related

Crashes When Saving Workbook...

Jun 8, 2009

As I've learned to develop Excel apps with vba over the years I've noticed that, if the Excel app starts to get too large (over 1MB) saving it will often cause the application to crash for no apparent reason - the result being that I lose all the vba code I entered before the last save - with the worst case being that, on occasion I have lost all of the vba code in an applications!!!

So, I've learned to back up often using a third-party utility that I use to save my applications, which works wonders in allowing me to save my application without it crashing. The application is called Code Cleaner 97.exe. It was designed around Excel 97 (which I still use) but if possible I'd like to get an updated version for Excel 2003 and Excel 2007, which I also use.

Does anyone know of a more recent version of this utility, or another similar utility that allows large Excel applications to be properly saved, etc?

Code Cleaner 97.exe was a freebie that was available through one of the old Compuserve Excel forums. It was a very popular utility and was suggested as a means to save one's Excel apps without the app getting trashed, etc.

I'm not expecting a freebie solution so I'll gladly pay for something that allows me to save my large Excel apps without them crashing, etc.

View 2 Replies View Related

Rename Workbook Without Saving In VBA?

Apr 5, 2010

Is it possible to rename a new workbook without saving it. What I do is I create a new workbook but I don't want to save it:

Sheets("Layout").Copy

Now Sheets("Layout") is standing in a NEW workbook called Map1.xls.

I want to rename Map1.xls to Invoice.xls without saving the workbook.

Then I do:

Application.Dialogs(xlDialogSendMail).Show
ActiveWorkbook.Close SaveChanges:=False

View 9 Replies View Related

VBA - Creating And Saving New Workbook

Oct 26, 2011

Ok, I'm trying to learn how to create and save a new workbook using VBA...having some issues with this error:

Run-time error '1004':

Method 'SaveAs' of object '_Workbook' failed.

The line is highlighted in red.

Code:
Sub Copy_ActiveSheet_1()
Dim FileExtStr As String
Dim FileFormatNum As Long
Dim Sourcewb As Workbook
Dim Destwb As Workbook
Dim TempFilePath As String

[Code] .........

View 7 Replies View Related

Macro For Saving Workbook

Dec 24, 2007

I Want A Code That Will Save My Workbook To A Specific File (different Form The One It Is Currently In) Using The Name That I Have Typed In Cell D13 In The Workbook

View 9 Replies View Related

Saving Workbook In VBA And Location

Dec 20, 2008

I am using this code in my ThisWorkbook, but it keeps coming back as an error for

ActiveWorkbook.SaveAs Filename:=ThisFile

Private Sub Workbook_BeforeClose(Cancel As Boolean)
'Saves file as what is in cell "C7" to specified network location - variant below
Dim Location, ThisFile As String
Location = "\Office-pcpublicCustomers"
ThisFile = Range("C7") & Format(Now(), "dd/mm/yy")
ThisFile = Location + ThisFile
ActiveWorkbook.SaveAs Filename:=ThisFile
End Sub

View 9 Replies View Related

Saving As A Workbook Through Inputbox

Feb 6, 2009

When the button is pressed, It opens a Mesage Box giving an alert to the User about what is He going to do...if he clik no the macro stops, if the user click yes then it opens an InputBox ....and the name the user writes there will be the name of the new book...

If working good if the user press OK ...my problem comes If the User press CANCEL in the InputBox...The excel try to Save the file as FALSE...and I don´t know how to avoid it.

Here is the code.

Sub Botón1_AlHacerClic()

X = MsgBox("Warning Bla bla ".Are you sure ?", vbYesNo, Title:="IMPORTANTE")

Naa = Application.InputBox("Write the file name Here", "New File Name")

If X = vbYes Then

ChDir "C:UsersROBERTODocumentsBASES DE DATOS"
ActiveWorkbook.SaveAs Filename:=Naa, FileFormat:=xlNormal _
, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _
CreateBackup:=False

End If
End Sub

View 9 Replies View Related

Workbook Doesnt Allow Re-saving

Dec 14, 2009

i have a workbook which is mainly use in construction building design... i want users to input ther respective data in that workbook to calculate and design only, but i dont want the user to save the changes they made...

View 9 Replies View Related

Shared Workbook Saving

Mar 5, 2010

How do I get a shared workbook to automatically save upon every change by each user. The only way I can get this to work (at this point) is to run a macro that updates every 45 seconds IN EACH WORKBOOK! It's counterintuitive because the workbook is shared (on a network), but each user must start the "time" macro in their "individual" SHARED workbook to allow the automatic saving.

What am I missing? There has to be a more efficient way to do this, right?

Code below
HTML Sub Time()

Call Save
Application.OnTime Now + TimeValue("00:00:45"), "Time"

End Sub

HTML Sub Save()

ActiveWorkbook.Save
End Sub

View 9 Replies View Related

Prevent Saving A Workbook

Jul 5, 2006

I'm wondering if it is possible to prevent a user saving a workbook. If opened as a read-only, excel throws up an option to save with an alternative name. I'm wondering if I can put some code in the Workbook_BeforeSave event that prevents saving of the document unless the application.username is myself.

View 2 Replies View Related

Saving Sheet But Not The Entire Workbook?

Mar 14, 2013

All I want to do is save a copy of one sheet called "Patient Stock Form", change the name to "Patient Order", and put it into an email. But my code is putting the entire workbook into the email. Here's the code:

VB:
Sub EMAILFORM()
Dim oApp As Object ' Outlook.Application
Dim oEmail As Object ' MailItem

[Code]....

View 8 Replies View Related

Saving Userform Data To Different Workbook?

Oct 29, 2009

Is it possible to have a userform open in a workbook and when the data from the form is saved, save it to a completely different workbook. If so, will that other workbook need to be open for the userform data to be saved?

View 5 Replies View Related

Closing The Workbook & Saving Automatically

Jan 25, 2008

I have my Excel workbook open & have made changes. Now I close it and Excel prompts me if I want to save the changes. Is there a way to just close the workbook and automatically accept any changes without have the "Do you want to save changes" message appear?

What about if it is opened in read-only mode? Typically the workbook will not save any changes unless you save it off as another file name. If there is a solution to my question above, can it be enabled only when the workbook is opened in edit mode, or will it not auto-save changes over the file because Excel knows it was opened in read-only mode?

View 9 Replies View Related

Close Workbook With Out Saving (Workbook_BeforeClose)

Oct 16, 2008

I read two pages on "Workbook_BeforeClose" trying to find a relative answer. I want to able to close a workbook with out saving and not rely on the user pressing the correct button, can this be done?

View 3 Replies View Related

Opening New Workbook And Saving Sheet.

Oct 21, 2008

I am trying to write code which copies the activesheet (called "Data"), opens a new workbook, pastes the data into it and closes the new sheet as "sales 2008" followed by the date. What I have at the moment is:

View 3 Replies View Related

Closing A Workbook Without Saving - Macro

Nov 28, 2008

Need the VBA code to close a workbook, and not save it? I need it to open a workbook, run a macro, and close without saving. The code I have thus far is:

View 3 Replies View Related

Saving Data To A Closed Workbook

Apr 3, 2009

i get an excel file with dynamic data everyday. is there away i can use a macro on this file to store this dynamic data to a specfic closed workbook and add the data onto the old data in that workbook?

View 4 Replies View Related

Rename Workbook Prior To Saving

Apr 6, 2009

I have a need to simply rename a workbook without saving. I have a master template named "IR QT" but, within the workbook, I run a macro that saves the file with content from a cell as the filename. After the 'Save' macro is executed, the sheet stays open, as planned, but obviously the file has been renamed. What I would like to happen at the end of the 'Save' macro is for the sheet to be renamed (not re-saved) to "IR QT". I just need the VBA code to put at the end of the 'Save' macro to do the rename back to "IR QT".

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved