I've had a new machine, and for some reason if i try and open excel files by double-clicking on a .xls file, excel tries to open each part of the filename individually!!!!
For eg, if i have a file called week 1 report.xls, and i double click that, it gives me 3 messages saying:
I have multiple spreadsheets that have formulas pulling from other spreadsheets that I use for daily, monthly & annual reports. After upgrading to Windows 7 from Windows XP these spreadsheets are no longer seeing the formulas if I open multiple spreadsheets at a time. This is a problem as my monthly and annual spreadsheets need to pull from multiple workbooks in order to give me monthly and annual totals. I have macros set at "Enable all macros" and have added the file location in "Trusted Locations". What else do I need to set in order to work on multiple spreadsheets at a time and the formulas pull data as needed?
i'm having trouble with the following code. The first if statement works fine, it's on the second pass that get problems, i get a 'ERROR 13 type mismatch' on the Windows(NewFN).activate line and i cannot figure out why.
Private Sub cmdsave_Click() Dim NewFN As String
Range("B5:G21").Select Selection.Copy
If Module3.firstTime = "y" Then NewFN = worksheets "Recalculate").Range "G5").Value ".xls" Workbooks.Add
Every time I open a new file in excel it opens up the file and the other file I have open disappears. Can I open a file so that there will be two separate windows?
I use the below code to close ALL open Internet Explorer pages. Im trying to adapt this to close ALL Windows Explorer Folders.
Dim Shell As Object Dim IE As Object Dim i As Variant Set Shell = CreateObject("Shell.Application") i = Shell.Windows.Count On Error Resume Next Do While i > 0 i = i - 1 Set IE = Shell.Windows(i) If TypeName(IE.Document) = "HTMLDocument" Then IE.Quit
I have a few macros that need to work with various worksheets which are in different windows.
1. Make the user name the files a certain way for consistency 2. Make the user type the name of each window at the start of execution
I was wondering if there was a more flexible option though: one which would allow the user to choose from a list of open windows (similar to the Window>More Windows>Activate function in Excel).
Ideally the macro would run and say something like, "Which of the following open windows contains dataset1?" "Which of the following open windows contains dataset2?"
Is there any way of making the default directory location for application.getopenfilename work properly with shared locations?
Presently I use ChDrive then Chdir but I cant use ChDrive if workbook is opened from a link in email for example. Please see below
I have a VBA routine that asks the user to load an existing file on startup.
I want the window for the file selection to open at the same folder every time. (the folder is on a shared drive)
The workbook to run the code will always be located on this same share at a fixed location.
My present code builds the path to the desired opening folder by collecting the drive letter from the current working directory (which has to be done as everybody maps there shares to different letters here, its not guaranteed to be the same! )
then i ChDrive to this letter.
Then I ChDir to letter plus myKnowndirPath
This works fine, the window always opens at my required folder. But only as long as the user has navigated to the folder containing the spreadsheet and then ran it from there. Because that way a drive letter is available.
However i found that if i sent a link to the workbook or its home folder. And the user opens the link or a windows explorer from that link and then runs file from there.
Then it stops working beacause there is no local drive letter in the working directory path. i.e. working directory shows as
I am trying to do something which is very slow and manual. What i have is like a seperate spreadsheet from every day and have to save each one down manually in the respective date. so for example column C has the date in already. Can you tell me how to save all the excel workbooks which are open (if i open them all) and then use the date in column C (which is in the format 20090217) and save it as a xls in the format 170209 and then close the workbooks?
sorry this is a huge question, just takes me so long to save them all.
I need VBA code to check if two spreadsheets are open at the same time. One is named OMD.xls and the other Report.xls
If they are not, then I need the current sub-routine to stop and exit, followed by a message box that informs the user to open the two spreadsheets at the same time.
I have about 10 open spreadsheets (the name of these changes each time but has a certain format). What I need to do is write some code to cycle through all the open spreadsheets and copy and paste the data into a single master spreadsheet. All these spreadsheets have a single worksheet.
i use excel 2007, it s slow to open a file by double-clicking and entering from windows explorer, by googling i fould a fix by adding "%1" at the end of command in "Application used to perform action" (folder options/file types/xls/advance/open). however, to open files in the same instance, i have to keep "DDE message" with [open("%1")]. With both "%1", excel now opens twice. How to fix it?
I have a sheet from which I load data. A normal cell looks like this:
Code: ='...dataOutput[1.csv]1'!E2
I wrote a script however that writes new data into a new sheet every day, and saves it with the name of the date. The obstacle is, that I won't have a sheet for each day (ex: weekends, holidays). For that reason, is it possible for excel to scan a certain folder, and open the 20th file when sorted by date to read from?
I am trying to set up a macro that hides certain columns of data in an automated spreadsheet that I don't need. How do I make the macro that hides the columns apply to all spreadsheets that are open except for the one I am in?
I used to think my excel skills were OK until I started working with userforms but I now realise that I have a long way to go.
I need to enter data from various WEB sites onto a worksheet and at the moment I'm toggling between each web site and the worksheet. What I would like to do is set up a userform which I can enter data from each page into and when finished hit a commandbutton to transfer it to the worksheet.
I'm mostly OK with creating the userform but not sure what code, and where I need to add it, to keep the userform on top of all other windows.
Also not sure if it's possible, I have another worksheet that has a series of hyperlinks that when selected open a web page, I can create a combobox that shows the the display names of the hyperlinks but not sure what code I need to add a commandbutton or some other control that will open the hyperlink.
way of getting two sheets to scroll together, so when I scroll one window the other one moves too? Some text editors have that future (IIRC UltraEdit does)
I can't find a scroll event in the windows code to trigger a macro to run itself.
I can get around it by using a selection change event which would restrict me to moving around with the cursor keys/Pageup/down, but I've got 15,000 to review regularly in a short space of time and it would be quicker by mouse
I have put together the following code and it works fine on my PC. However, we are a mainly Mac based company and I nead it to work with a Mac. I am using the Actual ODBC Driver for Mac to give me a ODBC connection. I can do the query in excel but setting it up as a macro just will not work.
Sub Sales_Query() Columns("C:D").Select Selection.Delete Shift:=xlToLeft Range("B2").Select Dim area As Variant area = Range("B2") With ActiveSheet.QueryTables.Add(Connection:= Array("ODBC;DSN=my_database;Description=My................................
I am looking for the best way to create a new file in windows. I am just looking to create a save filename template. After I run a macro, a graph is created and printed to pdf. I want this macro to create a filename, so that when the save as dialog box opens, I just have to doubleclick the existing filename. Then I save the excel workbook as another.
For example, after I run the macro, the pdf printer will open up a save as dialog to c: emp. I want to have this macro create two files there, one DaveGraph.PDF and one DaveExcel.xls. They really won't be files, just names. They can be 0kb files. I want it to be as efficient as possible. I know I could create a new workbook and save it there with the correct name, but isn't there an easier way?
Is there any way of running particlular excel workbook when Windows start? Like when Windows XP or Vista start, excel workbook (Vehicle Maintenance) will run automatically? Not so sure if can use VBA or edit registry system which I would'nt like to touch at work.
Im having trouble switching between windows that are open in separate instances of excel.
I used to be able to switch easily between these workbooks when they were both being being run in the same instance of excel.
But since having to change it so the workbooks are opened in seperate instances, i cannot get it to work, the code just fails when it trys to activate the first window.
I currently have the below code:
Code:
Sub CloseAndSave() Application.EnableEvents = True '//Activate InfoHub workbook and put a tick in the checkbox. Workbooks("403 InfoHub.xls").Activate Sheets("HOME PAGE").ToggleButton1.Value = True
I have the below VBA code that I'm working on where I run it after I already have a workbook entitled BRNewBusiness121106.xls (or whatever day it is when I'm running the code) that's open, and the code opens another workbook, BR-MasterAccounts.xls and then does some work between the two workbooks. The code is stopping with a "subscript out of range" error at this line: Windows("BRNewBusiness" & Format(Date, "mm/dd/yy") & ".xls").Activate
Why is it doing this? What change do I need to make so the code will activate that already-open workbook?
david --------------------------
Sub testAfterDAKCSupload() ' Application.DisplayAlerts = False
MsgBox "new code follows...deskcheck before putting into production" 'edit the below remaining steps to get working properly
I have just messed up my explorer window and can't get it back the way it was.
I currently have three windows showing, Project, Properties and Code. Previously the windows were all linked so that if I widened the code window, the other two would become narrower. If I made the Project window taller, the Proerties window would automatically reduce in height.
My three windows are now totally independant of each other.
I downloaded a workbook at one time and it actually installed the workbook as if it were an actual program on my computer. I would go to Start-All Programs-and it was listed there. I thought this was very cool. Is something like this done through excel/vba or was a third party application used in conjucnction. I know some of Dave's evaluation workbooks are setup this way, but I can't remeber which one.