Save Just A Variable From Workbook To Disk
Apr 11, 2008
I have a workbook with a field that contains the users name in cell B1. The first time the user opens the workbook, they put their name in this cell. Is there a way that that name can be saved to disk outside of the workbook in the same directory as the workbook is saved and a formula be put in workbook.open so that it will go get this name variable and insert it in B1 so the user doesn't have to enter their name each time.
I now have them putting their name in and saving the workbook which works until I send out an upgrade. Then they have to type in their name again.
View 9 Replies
ADVERTISEMENT
Mar 4, 2014
Using Excel 2010, I have a workbook containing a variable number of PDF files captured as embedded OLE Objects. I wish to save each of the embedded PDF files to disk and assign the filename based on the contents of column 1 of the row containing the OLE Object.
View 1 Replies
View Related
Jul 31, 2009
I have figured out how to save the workbook using a variable to saveas but I would like to create a new folder to place the new workbook into. I have tried a few things a am not having any luck. I recorded a macro and the code it produced is as follows.
View 6 Replies
View Related
Dec 9, 2008
I have looked at many different examples of uses of the average function but I haven't found any examples of what I need it to do. Here is the code I am trying to use, but I am getting some errors.
View 6 Replies
View Related
Dec 3, 2012
I have an expense report, which was originally done in Excel 2003. It still prompts users to open as read only however if they select no, they are not prompted for the password, and it has allowed them to save, so when the next person opens it, they have the previous person's report instead of the clean workbook. I have tried everything to put a password onto it. I know this is really basic stuff, but maybe I am missing a step? I want the end user to be able to make all the changes they want in read only mode and then do a save as, but if the select No when prompted "Open as Read-only?" they should have to put a password in.
View 4 Replies
View Related
Aug 11, 2007
I'm trying to make it so that a backup copy of my file is written to floppy when the file is saved (but not with SaveAs). So far, I have the following code, which if the floppy is in the drive works fine, and doesn't error out if the disk is not in the drive. But it doesn't make sure that a backup copy actually got made. How would I check to see if the disk is in the drive and loop somehow until it was so that the file got saved to floppy?
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
On Error Resume Next
Application.DisplayAlerts = False
If Not (SaveAsUI) Then
MsgBox "Please Insert Floppy Disk in Drive A:"
ThisWorkbook.SaveCopyAs "A:" & ThisWorkbook.Name
End If
Application.DisplayAlerts = True
End Sub
View 9 Replies
View Related
Apr 27, 2007
I have a huge workbook that takes up a lot of memory. The user saves her work every day by saving the entire workbook. Hence, we are using up a lot of hard drive space. I have been trying to find a way to save the relevant worksheets in a format that consumes less disk space. I find that if I save a single worksheet as a web page without the option of interactivity the file is only about 50k. But I need to save three worksheets, not just one. Is there any way to do this? If not, is there any other SAVE AS method that allows one to save three worksheets at a reduced file size? I do not need interactivity, I simply need for the user to be able to go back and view the relevant information in each file.
View 7 Replies
View Related
Apr 15, 2014
Is it risky for someone to edit an excel document while it is still in the flashdisk or external hard disk? I was told that this habit can lead to loss of data or the data can be affected if someone does this. I was told that I have to copy/cut paste the document onto my desktop, edit/ work on it then move it back to the storage device. Is all that work necessary, or can I simply work on the document while it is still in the flashdisk or external hard disk..
View 6 Replies
View Related
Apr 26, 2013
If I want to improve my excel performance like ability to open multiple excel and sheets to perform calculation, should I change to a SSD or a faster intel chip? My current PC sometimes give me a black screen for my excel sheet or is unable to save certain sheets when I open too many sheets.
View 3 Replies
View Related
Apr 5, 2007
I have a update/Save button on a spreadsheet. So when clicked it updates another sheet and saves the workbook.
how can i have it run the macro when they don't click the button and do
File -> Save.
View 9 Replies
View Related
Jun 17, 2014
I have been trying to edit a code which previously saved a copy in a new workbook to a specific folder/path. (Additionally it copies and clears some figures, but this is working as it should.)
However I would like the copy to be saved at the same location as the original workbook, regardless of the path the original workbook is saved.
I.e if I need to move the workbook containing the code to a new folder/location, when using the macro, the new copy should be stored in the same folder/location as the original one.
For now it is only saving the copy into "My Documents"
Code:
Sub Macro1()
'
' Macro1 Macro
' Macro recorded 16-02-2009 by ceng
'
Sheets("Bunker ROB").Select
Sheets("Bunker ROB").Copy
ActiveWorkbook.SaveAs Filename:= _
ActiveWorkbook.Path & Range("D3"), _
FileFormat:=xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False
[Code] ........
View 2 Replies
View Related
Jun 25, 2014
I'm trying to find a way to save a single sheet of an excel workbook and in the same process delete all vba code and shapes from the new single sheet workbook. I was looking around and found this code which does save only the single sheet to a new one sheet workbook but doesn't delete the vba and shape that I have used to assign macros to in the original.
Code:
Sub SaveSheetAsNewBook()
Dim wb As Workbook
Dim InitFileName As String
Dim fileSaveName As String
Dim wshape As Shape
InitFileName = ThisWorkbook.Path & Format(Date, "mm.dd.yy")
[code]....
View 2 Replies
View Related
Sep 28, 2012
I have two workbooks open. I need to "Save As" and close workbook 2 with a file name from a cell in Workbook 1. The macro is running from workbook 1.
I'm guessing a change in the last line. I don't know what Dim means either.
Dim FName As String
Dim FPath As String
FPath = "G:"
FName = Sheets("sheet 1").Range("A1").Text
ThisWorkbook.SaveAs Filename:=FPath & "" & FName
View 1 Replies
View Related
Jul 20, 2006
I would like to save a module level variable but do not know how to do it. I have tried using the public key word. If I put it in the sub, I get an error when it tries to compile the sub. If I put it outside of a sub, it just doesn't work. Surely this is something easy.
View 8 Replies
View Related
May 8, 2008
I found a thread that is very much similiar to what I tried to achieve that is to save 110 files into CSV file format here Save Multiple Files In Folder As Text Format.
May I know what changes should I make to this code in order to save it into CSV file format?
ActiveWorkbook.SaveAs targetFolder & Left(aFile, Len(aFile) - 4) _
& ".txt", xlTextMSDOS
View 3 Replies
View Related
Feb 14, 2009
is it possible to work on a workbook lets call it 123
once macro button is pressed it opens workbook abc
then saves it as what ever is in cell a1 to a directory?
View 14 Replies
View Related
Jan 23, 2012
the following scenario.
I am using the following code to save a workbook as a macro enable workbook on the selected path as today's date. But it is being saved as a macro free workbook.
Below is the code in module:
Sub save_file()
Dim tDate As String
Dim FileSaveName As String
Dim fPath As String
tDate = VBA.Format(DateSerial(Year(Date), Month(Date), Day(Date)), "dd-mm-yyyy")
'FileSaveName = Application.GetSaveAsFilename(InitialFileName:=tDate, filefilter:="Excel Files(*.xlsm),*.xlsm", Title:="Please save the file")
[Code]...
View 4 Replies
View Related
Mar 1, 2013
I have a spreadsheet that data gets exported to from a software program. There is information such as customer name, part number, inquiry number, etc that I'd like to use to develop a log of all my estimates I create for parts. I'd like excel to take the cells I select and insert them into certain cells in the other workbook and automatically save that workbook. This will create a log of all my estimates where I can then link the full estimate to the log. The information will have to go in the next available row. Is there any way I can accomplish this without having to open the other workbook and save the work book each time?
View 1 Replies
View Related
May 27, 2006
Need VBA code to save column J of open workbook called LmbcAcctsPayable.xls, Sheet1, to same workbook & sheet called LmbcAcctsPayable.xls, Sheet1, when save is not selected.
Reason: The workbook is usually not saved because it is more of a templet with names in column A. Column J is updated with a date when a row is used so I need the column J to copy automatically to the blank templet when exiting without saving (using ThisWorkbook.Save = True in Auto_Close). That way, rows not being used for a long period of time can be periodically eleminated.
View 3 Replies
View Related
Aug 13, 2012
I am still learning VBA and am wanting to know can you save a file with a variable week number?
e.g file name = 657 13082012 CP
The Following week would need to be 658 20082012 CP
View 1 Replies
View Related
Oct 4, 2008
I am still a novice in you standards, but have run into a problem and hoping you all will have some insight for me.
I have a workbook that I am parsing data from the first sheet and putting the data onto the second sheet. Before I place the values in I want to format the cells with boarders, colors, alignment, and in some cases validation (but I can worry about the validation later).
Currently what I am doing is using a 3rd page that has a group of cells that have the formats I want in place before I start. The code will then parse the data and when it finds the data I need go to sheet 3 and grab a range of cells and paste those cells to sheet 2 and then write the data over those cells. This allows me to format the document as I create it.
The problem is that I am going through 25k of lines and on average this function is running 40+ minutes. If I run the same script with out the formatting it only takes at most 2 minutes.
So on to the question.
Is there a way that I can start of my script by grabbing all the format information before I parse the data and save it as a variable? Then instead of doing a copy of the format it would just apply the formatting that is saved already. I would think this would be much faster of a process.
View 9 Replies
View Related
May 31, 2012
The following code stops at the red line with "Method 'SaveAs' of object '_Workbook' failed.
FF="xlCSV". It works fine if I replace
Code:
FileFormat:=FF
with
Code:
FileFormat:=xlCSV
Code:
Sub SaveIt(FileNm, FF)
Dim FSO As Object, a
Set FSO = CreateObject("Scripting.FileSystemObject")
If FSO.FileExists(FileNm) Then FSO.DeleteFile FileNm
If FSO.FileExists(FileNm) Then
[code]....
View 2 Replies
View Related
Aug 30, 2012
HTML Code:
Private Sub SaveAsAndShare()
ActiveWorkbook.SaveAs Filename:= _
"S:LdnPath1Path2Path32012Folder1Folder 2Aug12ReportName " & Format(Date, "MM-DD") & ".xlsx", FileFormat:=xlOpenXMLWorkbook, CreateBackup:=False
End Sub
HTML Code:
ActiveWorkbook.SaveAs FileName, , , , , , xlShared
My code is the first bit, the 2nd code I found from another post, I want to add xlshared to my code above so it is shared when saved down.
View 4 Replies
View Related
Aug 26, 2006
I snagged this code out from another project I wrote, and it works fine in that one, but doesn't in the new project.
What I want, is when the person presses the exit button, it will save whatever was done, its running as a form printer and database. The code below is the code for my exit button.
Private Sub CommandButton4_Click()
Dim sAnswer As String
Dim i As Integer
' ****************
' ** Exit Button**
' ****************
When it gets to "If ActiveWorkbook.Saved = False Then" it does put the question out "Do you want to save changes" I click Yes and it doesn't save it.. I have tried both activeworkbook and thisworkbook ... I copied the code and verified all is good to go..
View 9 Replies
View Related
Mar 21, 2013
I have got a master workbook and I have written macro to copy and paste data on another workbook. write a macro to save the new workbook to a file path with a file name where both file name and path are stored in master workbook sheet...
View 5 Replies
View Related
Aug 19, 2014
I have a macro that I have been trying. I want to take a workbook and do a saveas, remove one of the tabs called UPDATE closing the original and renaming and dating the new workbook.
View 2 Replies
View Related
Jun 23, 2009
If i have 2 workbooks open and want to save only one of them and it is not the active one and i cant make it active as it is hidden.
View 2 Replies
View Related
Dec 26, 2008
I have a Sub SaveFile() in a standard module and a Sub in ThisWorkbook module that will call that Sub; however, I have another Sub CopySheet() that I would like skip the Sub SaveFile(). The reason I do not want the Sub SaveFile() to run is because I am making 19 copies of the first sheet and I do not want the user to have to click "Yes" 19 times. How can I have Sub Savefile() ignored when I run Sub CopySheet().
Sub SaveFile()
Dim Ans As Integer
Dim Filt As String
Ans = MsgBox("Confirm you want to save this File." & (Chr(13) & Chr(10)) & _
"File will save as: Backup - (SheetNumber).xls in current directory", vbYesNo)
If Ans = vbNo Then Exit Sub
Application.DisplayAlerts = False
ThisWorkbook.SaveCopyAs Filename:=ActiveWorkbook.Path & "Backup - " & ThisWorkbook.Name
.............
End Sub
Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Call SaveFile
End Sub
Sub CopyBook()
ActiveWorkbook.Save
Dim i As Integer
For i = 2 To 3
ThisWorkbook.SaveAs Filename:=ThisWorkbook.Path & "" & CStr(i) & ".xls"
Next i
ActiveWorkbook.Close
End Sub
View 9 Replies
View Related
Jan 28, 2013
am trying to create a workbook template which collects data from users with user forms and some macros. Users assign a project name when workbook opens and then they are able to save as the workbook with name of project name. But i don't want them to save on my template mistakenly. How do i prevent this? I tried workbook_before close sub but i can manage that it recommends to save workbook with project name and if you don't want, it still asks you if you want to save workbook before close
View 7 Replies
View Related
Dec 11, 2013
How can i save and close one workbook in excel with vba code.
View 2 Replies
View Related