Macro To Save Excel Files As PDF With Password

Mar 3, 2014

I am looking to convert 2000 excel files in PDF and include a unique password (password ideally will be their employee number). Is this possible using VBA, I am thinking that if I have a seperate excel file with the name of each file and the applicable password it might be but not sure?

View 3 Replies


ADVERTISEMENT

Excel 2007 :: Save Files XLS In Macro Workbook And Send Email

Sep 3, 2012

I am using 2007. This may be something simple but I can't seem to find a solution to this, I have an excel macro enabled workbook which produces a daily report the final task is to save and send an email but I need the file to save as an xls rather than xlsx as some of the recipients are unable to open the file here is the code used for the tasks in the

workbook:Sub Step1_Refresh()
'
' Step1_Refresh Macro
'
'
ActiveWorkbook.RefreshAll
End Sub
Sub step2_save_close()

[Code] ........

View 1 Replies View Related

Excel 2007 :: Save Files XLS In Macro Workbook And Send Email?

Sep 3, 2012

I am using 2007, I have an excel macro enabled workbook which produces a daily report the final task is to save and send an email but I need the file to save as an xls rather than xlsx as some of the recipients are unable to open the file.

Here is the code used for the tasks in the:

workbook:Sub Step1_Refresh()
'
' Step1_Refresh Macro
'
'

[Code]....

View 7 Replies View Related

VBA Open All Text Files In Excel In Folder And Save Them As Excel File

Dec 7, 2013

I have some daily text files in a folder (so about 30 of them each month), which in the end of month, I need to open them up in excel, format them so that I can use the information for my analysis.

I would like to create a macro, to quickly open them all up at once and save them each individually in .xls or .xlsm format.

I am new to VBA and after some research online, I was able to have the files open with the following code. but now I don't know how to proceed further to save them one by one with the same name but in .xls or .xlsm format.

Sub Opentxtfiles()
Dim MyFolder As String
Dim myfile As String

[Code].....

View 2 Replies View Related

Save Different Tab Excel To Individual Text Files?

Nov 14, 2013

I want to get a vba which will convert an excel with different tabs to individual text files. IT MUST BE PIPE DELIMITED.

So if there is an .xls file with 5 different tabs, i should get 5 text files with each text file getting name of the worksheet it was created from.

I have a similar code but somehow it is doing the conversion only for last worksheet, also it is saving the file in the same name as workbook.

Code:
Sub save_as_text()
Dim i As Long, txt As String, delim As String
delim = "|"
With ActiveSheet.UsedRange
For i = 1 To .Rows.Count
txt = txt & vbCrLf & _
Join(Evaluate("transpose(transpose(" & .Rows(i).Address & "))"), delim)
Next
End With
Open Replace(ThisWorkbook.FullName, ".xls", ".txt") For Output As #1
Print #1, Mid$(txt, 2)
Close #1
End Sub

View 2 Replies View Related

Excel 2010 :: VBA To Save Tabs As New Files

Apr 15, 2014

I have a file containing 20+ tabs and would like to be able to save each tab as a separate Excel file (with the same name as the existing tab)

View 6 Replies View Related

Save / Convert XML Files In Excel Format Without Open Them Into XLS?

Oct 11, 2011

Is there a way to convert all files in folder, in this case, xml in excel format to xls without open them?

I recorded the macro below, but this needs to "Open" and "SaveAs" the current file in folder and there are a few thousands of xml files in folder.

I was wondering if through some ADO or VBA code this can be done without open the files in order to save resources and get the work done faster?

Code:
Sub Convert_XML_to_XLS()

Workbooks.Open Filename:="C:MyPathInputFile.xml"
ActiveWorkbook.SaveAs Filename:="C:MyPathInputFile.xlsx" _
, FileFormat:=xlOpenXMLWorkbook, CreateBackup:=False '
End Sub

View 3 Replies View Related

Save As Macro :: Tab Delimited Files

Oct 22, 2009

I use a macro that saves my activesheets in text(tab delimited).

I am trying to find how to save my worksheets as tab delimited files without having to open the notepad later, in order to press the backspace button. Just to clarify more, if a sheet has 15 rows of data, the tab delimited file will be created with 16. Is there a way to save the actual number of rows in the text file or this is a default operation in excel that cannot be changed in any way?

View 9 Replies View Related

Reformat Directory Of Text Files And Save As Excel Simultaneously?

Mar 3, 2014

I have several hundred text files which I would like to reformat and save as excel without needing to open each file individually.

I'm entirely new to working with macros, so, I was able to use macro recorder to save the steps to reformat the file, but would like setting up the part of the macro to automatically open and reformat all of the files.

View 2 Replies View Related

Excel 2007 :: (Save Files In Format) Settings Keeps Changing

Sep 28, 2011

I am having trouble getting Excel 2007 on my work computer to save as .xlsx by default.

I have opened the Office Button > Excel Options > Save > Save files in this format and selected "Excel Workbook (*.xlsx)," and if I save as before closing Excel then it works perfect and saves the file as .xlsx. However if I close Excel, re-open it later and save a new file the default "Save as type:" is "Excel 97-2003 Workbook (*.xls)" and if I open the save options again the "Save files in this format" option is reverted back to "Excel 97-2003 Workbook (*.xls)."

I have finally overcome the [Compatibility Mode] issue by saving a file named "Book.xltx" (not "Book1.xltx") in the two default locations "C:Program FilesMicrosoft OfficeOffice12XLSTART" and "D:Documents and SettingsusernameApplication DataMicrosoftExcelXLSTART" (we use the D: drive at work for personal files). I thought this would solve the save as issue but it hasn't. I have also changed the "Save files in this format" before saving the .xltx files in the locations to apply the settings to those specific files but that hasn't worked.

It is on my work computer so I am limited in what settings I can change because they have them pretty well locked down.

View 7 Replies View Related

Open Excel Files In A Folder - Change Layout And Save

Nov 11, 2013

There is a folder with all excel files with the same structure. I need a macro, who opens one file by one in a folder, change the layout, and save it too same place with same name. Changing the layout will I do with macro record.

Sub AllFiles()
Dim MyFolder As String 'Path containing the files for looping
Dim MyFile As String 'Filename obtained by Dir function
Dim MyBook As Workbook
MyFolder = "D:LABODIESTSOST_DIEST" 'Assign directory to MyFolder variable

[Code] ......

View 9 Replies View Related

Printing Multiple Excel Files - Asks Me To Save Every Time

Jun 12, 2007

I'm trying to print out multiple excel sheets in which it asks me if I want to save the changes or not every time. I have macro settings set to low so I always accept the macros, if I don't have them set to low I'm always asked the question of whether or not I want to run the macro for over 20+ files. Anyone ever had similar problems when printing multiple files?

View 9 Replies View Related

Open, Edit, Save Macro - Various Files

May 22, 2006

i've got the code below, and if you notice the directory and file line, I want a loop that'll do what the macro below does, but also for files j1k2-j1k200. I'm hoping there's a macro that'll be able to do this, as I don't want to have to copy, paste and edit the same macro below 200 times!

Application. ScreenUpdating = False ' turn off the screen updating
Set wb = Workbooks.Open("C:Uni StuffStocks_J20j1ka.xls", False, False)
Sheets("Sheet1").Select
Range("B6:S6").Select
Selection.Replace What:="]w1", Replacement:="]w2", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
wb.Close True ' close the source workbook saving any changes
Set wb = Nothing ' free memory
Application.ScreenUpdating = True ' turn on the screen updating
End Sub

View 5 Replies View Related

Excel 2003 :: Printing Multiple Files With Explorer But Asks To Save Changes?

Dec 7, 2012

When selecting multiple excel files in explorer, you can right click and choose to print the selected documents. All documents gets opened and printed but the files stay open and you have to manually click on YES or NO to save the changes.

Is there a way not to see this window appear. So documents get opened and printed and closes itself without asking anything. Maybe it can be done with an option in the preferences. I'm not sure.

By the way the documents where created with excel vba just in case it's relevant. Also the version of Excel is an older version, I think it was Excel XP or 2002/2003.

View 1 Replies View Related

VBA Macro To Follow Hyperlinks & Save Files To Another Location

Jan 16, 2010

I am attempting to write an Excel macro that will be stored in a file called MacroFile. The purpose of the macro is to

1. Follow a hyperlink to an Excel file saved in a SharePoint type enviroment
2. Save the file to my laptop directory My Documents.

Below is the code I have written. The code is following the hyperlink and saving a file but is the focus file is incorrect.

Here is what happens:

1. Open up MacroFile and run macro
2. Hyperlinked file LinkedFile_1.xls is opened
3. File NewFile_1 is saved but contains the info from MacroFile
4. Hyperlinked file LinkedFile_2.xls is opened
5. File NewFile_2 is saved but contains the info from LinkedFile_1
6. Hyperlinked file LinkedFile_3.xls is opened
7. File NewFile_3 is saved but contains the info from LinkedFile_2

The files created are named correctly but have the wrong data in them. I need to know how to control which file is considered ActiveWorkbook.

Sub LinkAndCopy()
Application. ScreenUpdating = False
Application.DisplayAlerts = False
'**** Copy LinkedFile_1..................

View 2 Replies View Related

Macro To Save Files In New Folder With Current Month And Date

May 6, 2014

I have this existing macro which saves each tab into a separate excel file. However, I'd like for it to also save them together in a new folder using the current month and date (named: QA Files May_05.06.14). The month and date would change according to current month/date. How would I incorporate that into this code? I am not good with macros.

Sub tabname()
Dim ws As Worksheet
For Each ws In Worksheets
ws.Activate
ws.Name = Range("D1").Value
Next

[Code]...

View 4 Replies View Related

Save Ranges In Multiple Files To Text Files

Dec 21, 2007

I have a excel file that I enter information into. I have code that saves the files to a certain folder with the name, date, and time stamp for the file name. At the end of the day I might have 3 to 15 excel files I have created that day and I would like to take information from certain cells (examle: L3, B6, B7, B8, G8, and so on) and create a txt file with all of the information in it.

Example:
12/20/2007
Your Name
123 Somewhere St.
Here, OH 45111
Home Visit

12/20/2007
Someone Else
345 Anywhere St.
There, OH 45211
Hospital Visit

View 9 Replies View Related

Excel 2010 :: How To Save Excel File As Cell Reference Using Macro

Mar 5, 2012

I have created a macro in excel 2010 which enable the file to save (extract) data into separate location and name. The vba code for macro is as follows: Question: How can I save this workbook with reference to the value containing in cell B2? (it is named temporary now - as defined in the code)

Sub aaa()
'
' aaa Macro
'

[Code].....

View 1 Replies View Related

Save File Only Through Password

Aug 2, 2007

I tried to research this as much as I could, the thread below is a start but doesnt appear to be close...my request is a bit of a variant to this. I essentially need code that prevents someone from saving the file unless they have the right password.

View 6 Replies View Related

Password Protect Multiple Files?

Jul 22, 2004

is it possible to select multiple files (via windows explorer, or having them all open in Excel) and save them all, password protected (password to open) with the same password.

This was to prevent having to open 50 files individually, save as, then choose a password from "options". I'd rather be able to select all 50 and apply the same password to them.

View 7 Replies View Related

Remove Password From Multiple Files

Sep 28, 2007

I Need To Remove Password From All .xls Files ( More That 2000 Files )
From A Directory And It's Sub Directory, All With Same Password.

View 9 Replies View Related

Want To Be Able To Open Csv Files And Save As Xls Files

Apr 21, 2009

I have the code below. It openes all csv files within a folder, then delete rows depending on the value of a cell. Now it needs to save the file as a xls file ....

View 9 Replies View Related

VBA Enter Password To Protected Linked Files

Jul 11, 2013

I currently have a problem when retrieving data from an external document that is password protected. The below routine causes Excel to request the password to the file multiple times. Using the 'SendKeys' function provides a slight workaround although I am very keen to remove this. It also doesn't appear to update links once the routine has run though a couple of the 'For' loops.

I have it set so that the user has to input the first password request, but the 'SendKeys' simply hits enter for the rest of the requests. This doesn't stop the cells from being updated for the first run of the 'For m' routine but can fail on the following runs. Sometimes the second loop works, sometimes it doesn't and the user will have to manually update the links through the 'Edit Links' tool.

I tried turning Application.DisplayAlerts to false after the first password request but that didn't stop it from appearing. If it had, I was going to use the ActiveWorkbook.UpdateLink Type:=xlExcelLinks command to allow the user to update the links at the end.

Code:
Private Sub CommandButton1_Click()
'Application.ScreenUpdating = False
Dim d, m As Integer

[Code]....

View 1 Replies View Related

How To Send Files Via FTP With Excel Macro

Sep 22, 2012

I want to send via FTP to a linux server the following.

1- All files that are named checked.XXX.YY.mtc to path /var/docs
2- All files where the name begins with checked.conf to path /etc

PD: I have the IP address, user and password of the server.

View 1 Replies View Related

Macro To Append Excel Files

Aug 22, 2014

I am absolutely new to VBA and trying to create a macro for work. We get daily files with almost the same headers that needs to be consolidated at the end of every month. The headers on the files are usually the same, except at times an extra column may be added at the beginning.

I need a macro to do the following-

Prompt to select the desired files.

Read the headers and append only the desired header columns from these files to a master file(these are Account, User, Modified By, Version). The headers are present in row A. Also, the master file should select the header from the first file only and hence take only the data (row B) from the second file onwards so that the headers are not repeated in the middle in the master file.

In the master table, add a new column at the end which will be the name of the file.

In the master file generated, filter on the column "Version" and delete all the rows except Version="1.0"

Lastly, there are certain values in the excel files that need to be changed. So I need a replace function to change those values.

View 2 Replies View Related

Excel Macro Save As Cell Value?

May 28, 2014

i have a macro which copies data from each line, based on the row info copied.The current code i have is as follows:

Sub Macro1()
'
' Macro1 Macro
' Keyboard Shortcut: Ctrl+r[code].....

View 3 Replies View Related

Excel 2010 :: Save As PDF Macro?

Apr 10, 2013

I need to create a macro that will allow me to save a PDF from an XL file I am creating by running a report out of Access. This report yields a workbook with 2 sheets in it. The first tab (sheet) called "Mishkon" and the second called "Women's League". I need to save these reports separately as PDFs and they need to be saved in seperate locations. The first sheet (Mishkon) needs to be saved here: \OSOFSDataDayHabMishkon . The second sheet needs to be saved here: \OSOFSDataDayHabWomen's League . Here is the twist... Both sheets need to take their name from their G3 cells. I have Excel 2010 and dont want to print from my Adobe PDF printer. I would like to save as a PDF so I can run it off of computers that dont have the Adobe PDF printer installed.

View 5 Replies View Related

Open And Close Files Using Excel Macro?

May 16, 2014

I have a folder which has a set of files (Files may be anything like excel,pdf,word..etc).My rrequirement is: When i run the macro the first file to last file should open and wait for 5 sec and then close..I mean first time the first file should open and wait for 5 sec and close..Next 2 nd files shoul open and close after 5 sec..next third files should open and close after 5 sec...Like wise till last file..Is this possible to achive through macro code..

View 7 Replies View Related

Unable To Access RPT Files In Excel Macro

Dec 7, 2012

I am not able to access *.rpt files in excel macro

By using this below mentioned codes am not able to open the files from folder.

Code:
fpath = "C:Documents and Settings est"
f = Dir(fpath & "*.xls")
Workbooks.Open Filename:=fpath & f

View 4 Replies View Related

Macro To Collate Name Of Excel Files Within Folder?

Jun 4, 2013

I have approximately 5000 excel files in a folder with which are named by cost centre e.g 45684 (all differing lengths).

some script so I run a macro and an excel sheet captures the name of every single excel file in the folder?

View 2 Replies View Related







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