VBA PDF Code Alteration To Allow Specific Save Location?

Aug 23, 2012

I am running a macro in Excel which automatically generates a PDF of my worksheet. Currently it saves in the default location but i want to modify it to a specific location - P:Emergency Services|Procative ContactForms PDF.

The current code is;

VB:
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=Range("E7").Value _
, Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _
:=False, OpenAfterPublish:=True
Range("A1:E43").Select

View 5 Replies


ADVERTISEMENT

Save To Specific Location As Cell Name

Oct 14, 2009

I've been searching for ages trying to work out how to do this but have so far only managed to confuse myself. i have office 2007 and I have found some code to convert an excel sheet to PDF, however I need it to saveas the contents of cell (e6) and save to a location on our network drives (C:TEMP).

View 2 Replies View Related

Save Workbook To A Specific Location - 1004 Error?

Jul 21, 2013

Im struggling to get a workbook to a specific location. I have copied 3 worksheets to a new workbook, which im trying to save to an archive folder. Here is my code.

Code:
Sub atest()
Dim strFileName As String
Dim Archivepath As String

[Code]....

The problem is i keep getting an error (runtime 1004) saying the file could not be found?? well, im trying to create it !..

View 2 Replies View Related

Save Excel Sheet To A Specific Location Through Macro

Nov 19, 2009

I have a excel sheet which is completely formula driven and no macros in that.

I want to macro which can save that excel sheet to a specific location.

View 9 Replies View Related

VbA Code To Automatically Put Date Filename And Default Save Location

Aug 11, 2008

I have a spreadsheet that from a button I want to run a macro that will input todays date, the value in cell A1 as the filename into a default dialog box that is at a default file path. I have been trying to do this for several hours and can not completely get it done.

View 9 Replies View Related

Allow Save As With Different Location But NOT Name

Aug 26, 2006

I have the following code allowing the user to save a file using a custom macro button. However, I do not want to let them change the name of the file, just the location. How do I do this? ...

View 9 Replies View Related

Datestamp An Adjacent Cell & Not Allow Later Alteration

Oct 9, 2008

I have been using the following code for some time ....

View 8 Replies View Related

Set Autorecover Save Location In VBA

Feb 2, 2010

I have a macro which performs the auto save function perfectly. I'm looking at possible enhancements.

1. How to set autorecover save location in VBA? I know how to do this on the front-end i.e goto tools/options/save tab and set it there As i have disabled save autorecovery feature, autorecover save location is greyed out

2. How to create a backup of my workbook? So that my workbook will perform autosave and when i close this workbook at the end of the day all the latest changes are added to the backup and saved

View 2 Replies View Related

Save & Return To Last Location

Jun 9, 2006

User selects 'go to page B' on page A. They look at an object then click the object to go back to page A. Once back on page A they need to check data on page B, but in the same general location as where they just looked. This is over simplified, but pretty much sums up what I need to do. The code I have now is below, but keeps sending me to the last selection on my current page.

Public Sub SaveLocation(ReturnToLoc As Boolean)
Static WB As Workbook
Static WS As Worksheet
Static R As Range
If ReturnToLoc = False Then
Set WB = ActiveWorkbook
Set WS = ActiveSheet
Set R = Selection
Else
WB.Activate
WS.Activate
R.Select
End If
End Sub

Public Sub SetSaveLoc()
SaveLocation (False)
End Sub

Public Sub GetSaveLoc()
SaveLocation (True)
End Sub

View 2 Replies View Related

Automatically Save As PDF But Include Location

Sep 13, 2012

I have a workbook with 4 worksheets the first is called "input" which I use to enter information which goes to the other worksheets which arecalled engine, gearbox, doors.

I am stuck on the following; after inputting the information. I want to save as pdfs in various locations.

Is it possible to have 4 buttons on the input sheet which automatically :

Button 1 - Save "engine" worksheet as a pdf to a specified folder
Button 2 - Save "gearbox" worksheet as a pdf to a specified folder
Button 1 - Save "doors" worksheet as a pdf to a specified folder
Button 1 - Save the sheets as multiple excel files to a specified folder

View 4 Replies View Related

Save Location As String Or Range?

Aug 22, 2013

I often need to save the user's current position on a worksheet, do some stuff then get them back to where they started. In the past I've saved the current location sometimes as a string and sometimes as a range.

Code:
Sub BackToRange()
Dim BackToHere As Range
Set BackToHere = Selection
' do stuff
BackToHere.Select
End Sub

Code:
Sub BackToString()
Dim BackToHere As String
BackToHere = Selection.Address
' do stuff
Range(BackToHere).Select
End Sub

View 5 Replies View Related

Trusted Location - How To Save To And Access

Sep 29, 2008

managed to get a piece of code working to create unique sequential numbers for purchase orders, but only by "enabling all macros" which is apparently not recommended and could conceivably, as I understand it, leave a PC vunerable to viriuses contained in other imported files.

Please bear with me as I'm very new to anything other than basic Excel functions; macros were, until last week, something I didn't even know existed, let alone how to use them. Anyway, having got my macro working, I understand that the best thing to do is put it in a "trusted location" from where it will work automatically without requiring operator input (whilst still maintaining high overall security), rather than "enabling all macros", but I have a couple of issues with this.

Firstly, having created a folder in "my documents" as per the instructions, how do I save the macro there? What format should it be in? Surely not a word document? (as you can gather I am still really in the dark about all this). If not, what?

Secondly, how do I direct Excel to access and run the macro from this "trusted location" folder, rather than the already existing "module1"?

View 9 Replies View Related

Image Picture Resize And Save As On Different Location?

Aug 21, 2014

I have a picture on my image at userform. And I want to change my picture size ( like attached picture: fast image resizer program ) and save as different location. It is my school project.

Your valuable macro codes about ıf this and attached workbooks are very important for me.

View 3 Replies View Related

Macro To Prompt For Save Location And Filename

Feb 22, 2014

In a workbook, I use a macro to extract a sheet and save it as xls.

What code should I use to prompt the user to define the location and name of the new file to be saved?

View 1 Replies View Related

Save As File Type To Parent Location

Apr 21, 2006

I've been searching all morning through various posts on this subject, but I can't find anything that I can adapt to my needs. Here is the code I have:

ChDir "C:Documents and SettingsmynameDesktop"
ActiveWorkbook. SaveAs Filename:= _
"C:Documents and SettingsmynameDesktopBook1.txt", FileFormat:=xlText, _
CreateBackup:=False

This file will be used accross multiple computers and therefore the directory will always change. What I need to hapen, is for this code to save the workbook in the same directory as the origional file. I also want the file name to refer to a cells value, as I will be having the user define the name through a userform.

View 4 Replies View Related

Save File Under Current Name In A Selected Location

May 4, 2006

I get an xl file sent to me every day which I upload into a database. I then save the file keeping its name and save it into a selected folder. Is it possible to add a macro at the beginning of my current macro that saves the file using its name to a selected folder?

View 4 Replies View Related

Hyperlinks Won't Work When Save File To Another Location On Computer

Jan 8, 2014

I've created a spreadsheet of clients and info; I want each client name to link to their specific folder on my computer for easy referencing. I entered in all the links and they work just fine; however, when i tried to save the file to another location on my computer so it could be used by another employee (same terminal, etc, just in another folder) the hyperlinks stopped working.

View 5 Replies View Related

Save As Macro With Location Prompt But Fixed File Name ?

Dec 29, 2008

For a sheet that many non-expert users will use on different systems I need a macro that let's them save, print and send the results of their work. So I made a macro that makes a copy of only 1 sheet of the workbook and saves it with a given name to a given location. The problem is that I want a location prompt to ask the user where they want the file saved, while giving/suggesting them a fixed filename. A lot of different users will make and use their sheets so I need a certain naming policy to manage all the files. (date, location, etc)

View 4 Replies View Related

Excel 2010 :: Save Open File Location?

Nov 26, 2012

I just got a new computer and upgraded to Excel 2010 and Windows 7. When I try to open a workbook in Excel 2010, my saved file paths on the left side of the screen are gone. I want to put them back in there.

In Excel 2007 running Windows XP, I would just right click in the left side menu and click "add" and now that's no longer an option.

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

VBA Create New Folder In Current Location And Save Selected Sheets As PDF

Feb 2, 2014

I have the below code that saves selected sheets of my workbook as pdfs in the current file location. What I would like this code to be able to do is to create a new folder (named with todays date), and then save each of the pdfs into this folder.

Code:
Sub SaveWorksheetsAsPDFs()
Dim sFile As String
Dim sPath As String
Dim fPath As String
Dim wks As Worksheet

[Code] ........

View 3 Replies View Related

Macro To Save Worksheets As Workbooks- Name And Location To Change Each Month

May 30, 2008

I have a workbook with approximately 30 worksheets. This workbook already has a massive macro that I've written. I'd like to write a code that will take a designated worksheet, check to see if there is data in cell A2, if so, save it as a new workbook.

The name of the workbook should be predetermined, for example "SIA April(Previous Month) 2008(Current Year) P-Card Import Template.xls"
The months and years will need to change.

The file to save it in will also change monthly- for example- G:PCard DirectoryCloses2008 ClosesApril(previous month) 2008(current year)

View 9 Replies View Related

Open Multiple Files, Check Current Month & Save To New Location

Sep 15, 2007

I have 40 files in one folder which I named it as "CA" + month's name that I am working on. I need to do analyse these files monthly and save it under new folder. how do I automatically save them in new folder and name them for that particular month. Also, each file has worksheet which has one cell as "Aug-07" and the cell next to it has number of that month that is "08". How do I automatically change this also based on the name of the file, because file name month and month in the cell are the same.

View 9 Replies View Related

Generate A Folder Within A Specific Location

Nov 12, 2008

I am trying to generate a folder within a specific location (For now lets call it C:Jobs) that will be named as per the adjacent cell (Column H on attached)

Obviously if the folder already exists I want the code to stop.

But this code will have to generate a different folder for each row within the spreadsheet.

View 8 Replies View Related

Hyperlink To Specific Location In Word Doc?

Aug 11, 2006

I have an Excel file to distribute to users. This file must contain Hyperlinks to a Word file which i will enbed in a sheet of the Excel file itself. My question is this: Is it possible to produce Hyperlinks that go to the specific part of the Word document? So far, i am only able to Hyperlink to the first page of the Word doc, by doing a macro.

View 2 Replies View Related

Enter Line-Break At Specific Location

Jun 24, 2014

I know Excel is not the best tool for formatting sentences, but is there a way to insert a Line-Break based on a condition? (Either using Formula or VBA).

The situation is:A fixed-width cell, is a concatenation of 5 strings. Each of these 5 strings is a small sentence of 3-6 words; individually much smaller than the cell-width.2 of these 5 are fixed (one at start, one at the end). The other 3 are results of their respective "IF" formulas.Hence, the final sentence wraps over 2-3 lines.I need the 3rd & 5th sentence (the whole sentence, all 3-6 words of it) to start in a new line, only if they are going to be wrapped into two lines.

So If the wrapping results in:
String1 String2 Stri
ng3 String4 Stri
ng5

Then change it to:
String1 String2
String3 String4
String5

View 6 Replies View Related

Copy Specific Range To Offset Location

Jan 21, 2009

I would appreciate some ones help to correct a macro I'm trying to write. The macro copies 3 columns from Sheet1 to Sheet2 in a selected location. The 3rd column copied needs to be pasted in a different column in Sheet2.

View 6 Replies View Related

Copy And Moving A Tab To Specific File Location

Jan 22, 2014

I have code that has the user identify a file and then it puts that file location in a cell within the workbook

"Y:MastersProPricerENG WBS BOEXYZ.xlsx"

I want to copy a tab from the active workbook ("Resources (Spread or Load)") and move it to the workbook listed above.

View 3 Replies View Related

Add Custom Menu At Specific Location On Toolbar

Jun 28, 2008

I would like to use the attached "menu maker" file I found on Ron De Bruin's site using a Sheet to build the menu, yet be able to place it before the Help menu as suggested by this site [url] by finding the position of Help.

I have amended the code yet receive a "Compile error: Variable not defined" error.

View 6 Replies View Related

Populate A Given Number Of Rows Starting At A Specific Location

Jun 2, 2014

I have a spreadsheet where I track resources needed on a project. Each resource that is selected in the resource column has a corresponding % avg and an average number of months where the resource is used. % Avg and # of Months are found in a different worksheet.

What I am looking to do is, for example: if resource A will be on the project starting in May 2015 and assigned at 30% for 7 months, I want to populate 30% starting in the colunm labeled May 2015 and copy the 30% so that a total of 7 months are populated. Also, if any of the values change (i.e: the Resource Name or the Start Month) I want to erase all the percentages that were entered in the row. How can I achieve that with a VBA code? I have formulas that retrieve the # of Months and the % Avg already.

These are the columns that I have in my spreadsheet:

Resource NameStart MonthJan-15Feb-15Mar-15Apr-15May-15Jun-15Jul-15Aug-15Sep-15

View 2 Replies View Related







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