workbooks.open

  1. R

    Opening a Workbook from a File Dialog Box

    I would have thought that this should be fairly straight forward but I'm running into issues on opening additional workbooks from a userform. So yes, I have a userform with a button that when clicked opens up a number of additional workbooks. Is this a problem with the string sent to...
  2. L

    workbooks.open

    Hi The first code, I used workbooks.open without () and excel did give me error message. In the second code, I had to use () otherwise I will get error message. Why is that? Thank you so much. Sub wb_open_using_collection() Dim x As String x = InputBox("enter file name with path")...
  3. L

    workbooks.open with file browser

    Hi I want to improve the code below. I am thinking if it is possible to display file browser for the user to choose file from. Like when you click open in Excel, a file browser will be opened to help users to select a file. Can I do that here? Thank you very much Sub wbs_open() Dim xfile...
  4. C

    Use IF THEN ELSE to deal with file already open

    Hi. I can open a file remotely but am trying to create an error handling routine where, if the file is closed, open and update the links. If the file is already open it gives a FileInUse error and gives you the option to open it as read only I have been messing around with some code and ended...
  5. I

    accessing file remotely VBA code

    I have my xls with code on my desktop. The code needs to access a remote computer to open an excel file "items". How is this done? I tried a Z: and the following: Workbooks.Open Filename:="Z:\Fileserver\Admin1\Glen\101-061-909\Glen\price program\items.xls" but says could not be found...
  6. S

    Creating variables for file path names VBA

    I am writing coding for a rather large macro and I am trying to decrease the number of characters I use. One way to do this is to define a variable for the long file path name but it is not liking it. My coding is: ' Ask user for the period of the projection exercise PNumber =...
  7. G

    Open Close file with PW

    Hi Guys, I have a main excel file that has a indirect sumif formula linked to different protected files. Now, I want to open and close all files at the same time so that it would pull the correct sum without turning to #REF ! If I can turn the sumif formula to hard code values it would be...
  8. L

    workbooks.open - with or without ( )

    Hi I understand that workbooks.open returns a workbook object. So it returns something and because of that, I thought it should be call using ( ) for example workbooks.open("abc.xlsx"), but the author of this link https://analysistabs.com/excel-vba/open-close-existing-workbook/ called...
  9. J

    New VBA won't open file on Network Drive

    Hi folks tried this: Workbooks.Open Filename:="\\FS01\1300Shared\Marketing Folder\scorecard.xls" Error: Sorry we couldn't find \\FS01\1300Shared\Marketing Folder\scorecard.xls. It is possible it was moved, renamed or deleted. Also doesn't work using the Drive letter Workbooks.Open...
  10. T

    Open workbook without entire path

    Hello I open a workbook with the code Workbooks.Open ("\\Nas-bb\nas-2a\Quality Manager's Work Area\02 Laboratory Manual\10 Standard Inventory\C S O N H Standards.xlsx") Isn't there a more elegant way? Such as Workbooks.Open [C S O N H Standards.xlsx] Thanks for any help
  11. H

    Runtime error with exception handling

    In the following code I'm always getting a runtime error in the label file2 when it doesn't exist. As I've handled the exception it should technically proceed forward. When file1 doesn't exist, it's exception is always handled but an error always pops up in the file2 part. Sub testing()...
  12. Y

    Error in Loading DLL - CorelDRAW

    Hello, I have a decent understanding of vba, excel , etc... But am trying to run a macro that converts excel data into CorelDRAW. It had previously worked on my computer (august-september 2018), but when I try to run it now I get Run-time error '48' Error in loading DLL Specifically the issue...
  13. S

    Return Address of String in Closed Workbook with VBA

    I have almost 900 workbooks that I need to mine for data. These workbooks are nearly identical, but through the years the addresses for certain info has changed. I currently have a macro (below) which works nicely that opens each WB, looks for my defined string, and returns the location. For...
  14. D

    Password Protected File

    Hi, Is there any reason why this should not work: Workbooks.Open Filename:="S:\Stafford\Training Files\17. New_Training_Tracker\Template-Staff-Training-Manager-Database V1.2.xlsm", Password:="password", writerespassword:="password" I have also tried: Workbooks.Open...
  15. H

    Porblem to line

    Hi, How to resolve https://1drv.ms/u/s!Ai8CrEskdewXm1UXeAKPcd2mrkZJ due to last line below Workbooks.Open Filename:=fl fn = ThisWorkbook.FullName Debug.Print fn Application.Workbooks(fn).Activate
  16. J

    VBA add on query...

    Good afternoon - new here so please be gentle as i'm a total novice at VBA coding... I have a master spreadsheet that draws information from 3 password protected workbooks. In order to open then I have got the following code: Sub OpenSesame() Workbooks.Open Filename:="C:\folder\sub...
  17. R

    "Dir" problem

    Sub getCountryFile() Dim filePath As String filePath = "z:\allUK\EVR" If Len(Dir(filePath)) > 0 Then Workbooks.Open (filePath) Else Debug.Print "doesn't exist" End If End Sub Where filePath is valid, and the Workbooks.Open works fine if tried outside the...
  18. J

    manual open and workbooks.open macro producing different results

    Hello, I have two worksbooks, call them A and B. workbook A references cells in workbook B. When I manually open workbook B, the cells in workbook A update. When I insert code to open workbook B using Workbooks.Open, workbook B does open, but the cells in A do NOT update. I'm at a loss as...
  19. syndee

    Updating links with auto updating

    My Control File contains several worksheets. It links to data in other files in same folder. Just having problem with updating links with auto updating and returning to Control File.xlsm Tried this but need files to save and close except Control File.xlsm after updating. Is that possible...
  20. R

    Startup script (workbook_open) doesn't run

    I have a workbook which contains a startup script which works when opening this workbook manually. Now this is a viewer and is sometimes changed by an other VBA script. People who use this viewer sometimes need to refresh this document without saving. The script below is written to reopen the...

Some videos you may like

This Week's Hot Topics

  • VBA (Userform)
    Hi All, I just would like to know why my code isn't working. Here is my VBA code: [CODE=vba]Private Sub OKButton_Click() Dim i As Integer...
  • List box that changes fill color
    Hello, I have gone through so many pages trying to figure this out. I have a 2020 calendar that depending on the day needs to have a certain...
  • Remove duplicates and retain one. Cross-linked cases
    Hi all I ran out of google keywords to use and still couldn't find a reference how to achieve the results of a single count. It would be great if...
  • VBA Copy and Paste With Duplicates
    Hello All, I'm in need of some input. My VBA skills are sub-par at best. I've assembled this code from basic research and it works but is...
  • Macro
    is it possible for a macro to run if the active cell value is different to the value above it
  • IF DATE and TIME
    I currently use this to check if date has passed but i also need to set a time on it too. Is it possible? [CODE=vba]=IF(B:B>TODAY(),"Not...
Top