Launching Pdf Files In A Macro
Dec 17, 2008
I have a macro that launches word or excel files if the file address (e.g. C:Documents and SettingsHenryDesktop est.xls) is typed into cell A1 by looking at the last 3 letters of the file name.
I cannot find a way to enable it to launch pdf files as well (e.g. C:Documents and SettingsHenryDesktop est.pdf)
View 12 Replies
ADVERTISEMENT
Jun 9, 2009
I hide all Excel standard tabs and thus need a button on custom tab to record a macro. (I did this successfully with custom menu in Excel 2003.) In 2007 ribbon, I've reused the code for a button's OnAction, now going to callback that runs:
Application.CommandBars.ExecuteMso ("MacroRecord")
In Excel 2003, the stop button appeared automatically for me. But in Excel 2007, with hiding standard tabs, etc., I see no way to stop recording, other than running my button to return the Developer's tab, where the Record Macro button has changed to Stop Macro.
I'd like to either add a second button to my ribbon to stop recording the macro (but I can't find an idMso to use in a callback) or have my Record button change to Stop button, like Excel does. But I can't come up with correct code.
View 4 Replies
View Related
Nov 15, 2007
Sub test12()
Set wbABC = Workbooks.Open("C:ABCwithMacro.xls")
Call abcMacro 'this macro is stored in ABCwithMacro.xls
'error - sub or function not defined on 'call abcMacro'
End Sub
View 9 Replies
View Related
Sep 6, 2013
I have a macro to sort a very large list of materials by a variety of conditions.
The macro runs automatically when a cell on the master list spread sheet is selected and using If/ElseIf it sorts based on what cell they have selected.
Example
If ActiveCell = "ALUMINIZED" Then
ActiveSheet.Range("$A$14:$K$1945").AutoFilter Field:=2
ActiveSheet.Range("$A$14:$K$1945").AutoFilter Field:=4
ActiveSheet.Range("$A$14:$K$1945").AutoFilter Field:=1, Criteria1:= _"Aluminized"
Which is working perfectly. The problem I am having is that some of the cells are two lines so it looks like this:
BE
BEARINGS
I don't know how to get it to launch based on that cell content because of the line break in there. Can I make it launch based on the first two characters only?
View 5 Replies
View Related
Apr 14, 2006
I have a worksheet that is a graphical display of a call floor with its cubicles. I am able to pop up a box with many details about the workstation in the cubicle (see Display pop-up box when cell selected) for more details, and would now like to go further with this application.
Our practice is to use VNC to review the end users' screens when they call us for assistance; given that I know the machine name and IP address, how can I start a VNC browsing session for the target machine?
View 5 Replies
View Related
Mar 14, 2007
My company uses database software called Business Objects. At the moment few people are using the program and its reports as they can't find the key ones or workout how to run them correctly. As everyone is comfortable with excel. I am creating a series of forms to guide my users to the key reports. I like this method because it is very user friendly and I can add lots of descriptions. Unfortunately my programming knowledge is limited to excel so I can't write a standalone program as you might suggest I do.
The problem:
I want to launch the non-excel files using VBA. For example, a user will click on a "Customer" button to see a second form containing a list of customer reports. The user will then click on the button containing the name of the report they want to launch. I want the file to open. I tried using hyperlinks in an excel spreadsheet which works fine for opening the non-excel files, but it isn’t nearly as user-friendly or interactive.
View 4 Replies
View Related
Mar 3, 2014
I have a non Microsoft program file that I can open in excel. I usually make changes to the file; save it to its native format, then open up the non Microsoft program and open that file that I just edited in excel.
If I had to simplify it, using notepad as an example.
I open the TXT in excel and make changes.
Then Save the TXT in a folder location.
Open Notepad.
Browse to the folder Location.
Open the edited file.
I did not know if there was a quick VBA that I could use to get this to work?
View 9 Replies
View Related
Mar 13, 2014
I have a sub procedure that launches a hyperlink, but i have some conditionality so that if a cell (J3) is blank it pops up a message letting the user know they need to populate cell (J3). My problem is that if cell J3 is blank it pops of the message, but it still launches the link.
Sub NEWShyperlink()
Dim s As String
If Range("J3").Value = "" Then
MsgBox "Make sure you have entered the ticker symbol into cell J3!", vbExclamation, "Can not get News/Press Releases"
[Code] .....
View 6 Replies
View Related
Jan 30, 2007
I have a list of URLs and I wrote a small VBA code to launch them when the user clicks on a button, however, it launches in Internet Explorer. Is there any way to get it to launch in Firefox instead?
View 2 Replies
View Related
Jul 7, 2007
how to launch windows explorer from a path that resides in a cell using the code below.
Sub LaunchWindowsExplorer()
Dim PID As Double
Dim strRootPath As String
Const strExpExe = "explorer.exe"
Const strArg = " " '" /e,/root, "
'// Change rootpath here
strRootPath = "J:MyDirectoryWilliams,Bob 7264"
PID = Shell(strExpExe & strArg & strRootPath, 1)
End Sub
The problem I have is that once I have done this a number of times (probably somewhere between 80-100 times then I notice windows explorer starts to play up as if running out of memory. A reboot soon fixes that, however, I was wondering if there is anything I can add to the code to keep it from hogging up memory...if that is even possible.
When I say 80 - 100 times, I don't mean opening up 80 - 100 instances of windows explorer. I mean launching windows explorer, moving some files then closing that instance of windows explorer. Then coming back into excel and repeating that process.
View 9 Replies
View Related
Aug 16, 2012
Each time I click on an Excel file the worksheet will open up within an existing Excel worksheet that I have open. This is frustrating when you are working with two monitors or screens (laptop screen and additional monitor) and want to view each worksheet separately in separate screens. What I end up doing, which is not efficient, is I'll open the second worksheet which will open up in an existing worksheet that I have open and then I'll close it, and then launch a separate Excel worksheet and pull open the recent file and I'll have two open worksheets (not within same Excel worksheet I already have open). This allows me to grab and pull one worksheet in a separate screen and leave the other as I need both open on two monitors.
Question: is there a way to default Excel when opening or double clicking an Excel file to automatically open in a separate instance of Excel and not in an existing open worksheet?
View 2 Replies
View Related
May 27, 2007
I am trying to launch windows explorer from within excel vba. The routine below is borrowed from another post on this site and modified for my purposes.
Sub LaunchWindowsExplorer()
Dim PID As Double
Dim strRootPath As String
Const strExpExe = "explorer.exe"
Const strArg = " " '" /e,/root, "
'// Change rootpath here
strRootPath = "J:MyDirectoryWilliams,Bob 7264" ..............
View 9 Replies
View Related
Apr 25, 2007
i need to make a macro that takes workbooks or files and
runs them through another macro. i already have the 2nd macro
done and it is working perfectly i just need to know how to make the one
that finds the other files and runs them all through the macro i already made. My boss said that he will have about 150-200 files to run through this macro.
View 9 Replies
View Related
Aug 16, 2006
I have this macro that a friend of mine wrote on a windows machine, and I can't quite figure out the code changes needed for OS X. For someone who knows how to do this, I'm sure it would only take a second, but I've been banging my head against the wall on this thing for too long.
Option Base 1
Sub Data_Compiler()
Dim FileSelected
Dim FileName
Dim CompiledDataArray(1 To 30, 1 To 53) ' Array to store our statistics
Dim Counter1 As Integer
Counter1 = 1
FileSelected = Application. GetOpenFilename("Your Files,*.xls", , "Select Files", , True)
If StrComp(TypeName(FileSelected), "boolean", vbTextCompare) = 0 Then Exit Sub
For Each FileName In FileSelected
Application.DisplayAlerts = False................
I can get a "open files" dialogue box to pop up, but I can't figure out how to make sure that multiselect is enabled. I need to be able to run this macro on 11 files at once.
View 3 Replies
View Related
Apr 14, 2014
How to create a macro that selects only the 2nd file in a folder to be opened instead of every file.
So far the code below is opening every file.
Sub ConsolidateAll()
Dim wkbConsol As Workbook
Dim wksConsol As Worksheet
Dim wkbOpen As Workbook
Dim wksOpen As Worksheet
Dim FolderName As String
Dim FileName As String
Dim Cnt As Long
Application.ScreenUpdating = False
[Code] .......
View 2 Replies
View Related
Nov 4, 2008
There is a directory (K:/Munka) which contains many many Excel files with different names. What I would like to have is a macro which automatically opens and copies the content of each file into a new excel file, so I do not have to open so many files one by one and copy and paste the content of these file into a new file. Can that macro be created?
View 2 Replies
View Related
Dec 17, 2008
i need a macro to do a comparison b/w the two given files ...(book1 n book2) ...
n want the result to be like result file .. (result.xls)
View 6 Replies
View Related
Aug 4, 2009
I want to loop through all files in a directory and run a macro named "Main" in each file. The file that contain the loop-macro will stay in the same directory as the files I loop through.
View 4 Replies
View Related
Nov 16, 2011
I have a list of 35k files and the number of files keep changing every week. At the end of the month I manually have to sort the files i.e move files to the respective folders, delete them or take no action. This takes me an entire day. There are useless files which needs to be deleted.
Si NoFile nameFile PathNew PathAction
1Store C:Jay PersonalDesktopRXProjectSix SigmaStore.xlsC:Jay PersonalDesktopNewProjectSix SigmaMove
2AppointmentC:Jay PersonalTeam QualityAppointment.pptC:Jay PersonalTeam QualityAppointment.pptDo Nothing
3QualityC:Jay PersonalDesktopRXProjectSix SigmaQuality.docDelete
The format is as follows. File name is the file which I intend to move, File path is the current file path, New path is the path where I want the file to be moved, Action (Move, Do nothing, Delete) is the action i intend to take on the file.
View 3 Replies
View Related
Mar 22, 2012
I've successfully managed to run a macro to format a .xls file on opening it. How can I do the same with a .csv file?
View 1 Replies
View Related
Sep 22, 2012
I download 10-15 files from an interface which are automatically stored in a folder called 'Excel' on my Desktop. These are all .csv files. I need a macro script, that opens each of these .csv files, copies the contents starting from the 3rd line, and pastes them one after the other on another Excel workbook where this macro script will reside.
View 2 Replies
View Related
Mar 13, 2014
I need a macro to zip only the access files in the folder placed in the desktop.
View 1 Replies
View Related
Apr 30, 2007
If i have a folder with multiple csv files in it, all with different names can i get a macro to open all these files.
I know that i can if they are always the same name each time i run the macro but what i would like to do is to change the name of the csv files daily.
The reason is because i could have upto 50 different files a day.
So basically i'd like to click a button and open all the contents of the folder regardless of the name of the files inside.
View 9 Replies
View Related
May 14, 2007
I have data in several files named APT1, APT2, APT3, APT4, APT5... then I have a master file called APTMASTER. the fles contain certain data in sheet 1, what I need to know is if there is a macro that can copy data from all the APT 1 to APT 5 in the APTMASTER in such a way that it is one continous flow of data. Can this be done by just a button...
View 9 Replies
View Related
May 13, 2008
1. I've recorded a macro that imports values from 6 different .csv files at once. The problem is that not all of these files are going exist upon import. Is there a way to tell the macro to only import if the file exists? And to skip if the import of that file if it doesn't exist? Right now the debugger stops the macro because of file not found.
2. I want to press a button on Sheet 1 that copies Sheet 1 into a new Sheet that's named with today's date. E.g. I press the "Archive"-button, the sheet is copied to a new sheet with the name "051308".
View 9 Replies
View Related
Mar 11, 2009
I have several files in one folder. C:/data/
These files are named as date_xxxx.wk1. The date format is YYYYMMDD.
Everyday I need to rename them as date_cellvalueA1.xls where the date format is DDMMYY.
Cellvalue A1 is taken from each of the respective workbook.
As I need to rename them on a daily basis. Can I use 2 field, one to determine the directory path and one to determine what file name to search for.
If the files contain the YYYYMMDD, it will be rename to DDMMYY_cellvalueA1.xls
View 9 Replies
View Related
Feb 5, 2010
i want to write a macro for opening 200 excel files file names start with report0,report1,report2..................report200
View 9 Replies
View Related
Jul 5, 2007
The title pretty much sums it up, actually. I have a macro, and a beautiful piece of work it is. It selects a particular selection of the active workbook, parses it in a particularly thrilling way, and writes the result to a text file. I'd like it to do this for ALL the files in a particular directory (somewhere over 500 files, if that matters).
View 2 Replies
View Related
Jul 28, 2007
How can I code a Macro in Excel to search in a preset directory and pull out, aka open/run a certain Adobe Acrobat .pdf file automatically? Is this even possible to code in Excel Macro or is it out of its scope of what Excel VB code can do?
Right now I have a very repetitive task where depending on the value of a certain field in Excel I have to search for the right/corresponding .pdf file and open it up do work in the .pdf as well as the Excel worksheet... I have to do like hundreds of this. So is there a quick way to code in Excel that a certain value will open a certain file named .pdf acrobat file? Can other programs/files be called upon and ran/started/opened from within Excel Macro?
View 2 Replies
View Related
Aug 23, 2011
I've 2 excel files open. The first with my data, and a second with a huge range. I need to work with a macro that used vlookup to get a value from the second file in the first.
My code:
VB:
Sub mysub()
Dim i As Integer
Dim y As Integer
Dim match As String
Dim no_match As Integer
Dim rng As Range
'Set rng = Workbooks("wb2").Worksheets("Sheet1").Range("$A$1:$B$2704")
[Code] .....
View 3 Replies
View Related