workbooks.open

  1. Celly

    Workbooks.Open from OneDrive pops Microsoft sign-in dialog

    This is annoying, I have a local copy of a spreadsheet which has a VBA script to import data from an xlsm on a OneDrive directory. Even though OneDrive is already running and logged in, the Workbooks.Open line will result in a Microsoft sign-in dialog popping up (Type the email of the account...
  2. F

    Cell reference file path

    Hi guys, Short question today, in cell A2 I have the file I want the VBA to open: <tbody> <tbody> <tbody> e.g. C:\Users\user1\Desktop\Book1.xlsx How do I go about using information in cell A2 to open the file? I know it has to be Workbooks.Open Filename... but what comes next...
  3. L

    Workbooks.Open in Excel 2016

    The following code works in older versions of Excel (I have about 3 different versions to work with), but in Excel 2016 it fails (or maybe it is failing on the specific computer... but I'm thinking it is the version of Excel). No error message… it just doesn’t do anything. It will work if I...
  4. T

    Subscript out of range error

    What is wrong with the following? I get a Run-time error '9', subscript out of range error. Workbooks.Open "C:\Files\MyWorkbook.xlsx" Dim a As Long a = Workbooks("C:\Files\MyWorkbook.xlsx").Worksheets.Count Thanks
  5. M

    Defining the variable to make code simplier

    Hello Guys, Could you please advice how to define below lines to make it simplier: nome_file_master1 = "1011130800H - " & data_file6 & ".xlsx" Workbooks.Open Filename:=ThisWorkbook.Path & "\" & data_anno & "\" & data_mese2 & "\" & data_file3 & "\RUSSELL\" & nome_file_master1 & "" Set wb2 =...
  6. V

    Error when using Workbooks.Open with the * character

    Hi I have been running a code which opens an excel file whose name changes each day. The naming convention of the file is essential "Input file-[date]-[time].xlsx". Given the time can vary, I have used the * character to specify the file name: filesource_path = "N:\Input files"...
  7. C

    VBA to open other workbooks based on tab names

    I've been scouring the web and not finding what I need. Also "Excel 2013 Power Programming with VBA" hasn't been able to show me what I need. The code below Is intended to copy data from a range on all tabs except the first one "Skip Me" and paste it into other workbooks. The tabs in "master"...
  8. C

    VBA hangs when opening excel file

    I have a macro which loops through a list of excel filepaths. The macro will read each path, open the workbook, copy/pull various data out of each workbook and then pastevalues the data into a central workbook. There are about 2000 filepaths it will need to loop through. So as you can see, it is...
  9. D

    VBA Function can't open workbook.

    Hi all, I need to run a function that use some data from an opened file. Of course, if the file isn't opened, the function can't run. So I insert a code to check and open the file case closed. Problem is Excel is ignoring the Open comand if called by a function or running directly from the...
  10. H

    VBA coding to click OKAY past CSV SYLK error

    Hey all, I have a VBA code to open a CSV file: FileToOpen = Application.GetOpenFilename _(Title:="Please choose the Permit List to import", _ FileFilter:="CSV files only (*.csv),") If FileToOpen = False Then MsgBox "No file specified." Exit Sub Else Workbooks.Open Filename:=FileToOpen The...
  11. C

    Workbooks.Close and Open??

    2003 / w7 Things have been going swimmingly and then..... I used the Workbooks.Open FileName = Application.GetOpenFilename(fileFilter:="Excel Files (*.xls), *.xls") MsgBox "You selected " & FileName If FileName = False Then Exit Sub Workbooks.Open FileName:=FileName...
  12. V

    names not working after opening programmatically

    Excel2010 - OfficeXP and Office2010 I have a pretty big workbook with much names defined and used in it. When I do open this workbook manually, no problem. But when I open the workbook in VBA (Workbooks.Open (Filename) not one of the names seems to be recognised: every formala referencing a...
  13. J

    Quickest way to handle lots of files

    I threw together the two methods I use to open files in a folder based on criteria to see which runs quicker. (In this case it was m1 by roughly 1 second per file). I was wondering if there are any other accepted methods of opening files en masse. p is the folderpath and p2 is a filter such as...
  14. S

    Retrieve data from closed wb

    Hi. I have a folder with several workbooks in it and i want to retrieve those cells respectively from all workbooks in the same folder where the current workobok is located "H10, C12, A18, H18, H9" and i want the data from each workbook to be pasted in the same row
  15. Randall00

    'Workbooks.Open' doesn't open workbook! (!??)

    Hey everybody, Am I missing something here, or should this be working: Private Sub Workbook_BeforeClose(Cancel As Boolean) Dim strPath As String strPath = ThisWorkbook.Path & "\core.xlsb" Dim wbCORE As Workbook Set wbCORE = Workbooks.Open(strPath) End Sub I'm just trying to get this...
  16. C

    Open all workbooks to perform an action

    I need to a workbook in a specified folder, copy any sheet that contains "Dec" to a new workbook, save and repeat for all worksbooks in a folder Here is the code I have so far and it only opens all the files in the folder I specified but doesn't take the action to copy the sheets I have...
  17. C

    delete sheets with contain variable names

    I need to create a macro that will delete all sheets in a workbook that do NOT contain the substrings "Dec" and "09". All other sheets in the workbook may contain some variation of the months of the year (e.g. October 09, Sept 09, Jan. 09, etc) Some workbooks will contain 2 or 3 sheets with...
  18. J

    VBA openworkbooks using file variable

    Hello all and Happy Friday, I was hoping somebody might know if it is possible to open files using a variable and loop. I want to define the name and path of the files so they can be easily changed later and then loop through them so that I can extract some data from each one. I thought...
  19. A

    Automatically Opening New Workbooks from Existing Ones

    I am working with a three-page workbook. When I click on the separate sheets, they open in an entirely new, unsaved workbook. For example, the sheets are labelled London, New York, and Paris. I will click on the Paris sheet and it will open as an untitled workbook with the complete Paris...
  20. D

    Suppress open events when using Workbooks.Open

    I am not a programmer but. I have built a sub that prompts the user for a folder then opens every workbook in the folder 1 at a time to get stats on the contents of each workbook. Worked like a dam until I ran into an unexpected bug. Some of the users built on open events in their workbooks. ...

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top