thisworkbook.path

  1. K

    Not understanding syntax of fso

    Hello, I'm trying to refer to a textfile and set that as an array, but i'm met with an error when trying to refer to ThisWorkbook.Path (Bad file name or number) And I don't understand how to fix it. I'm using the same type of argument to open/refer to a Workbook, and this works just fine. I'm...
  2. A

    Issues with thisworkbook.path

    I've searched everywhere and I've tried using the tips I've come across, however I still run into isses using Thisworkbook.path. This code works fine if I use $Environ(username), and put the path, but I'm not sure the other ones in my office has the onedrive folder saved in the same location. It...
  3. T

    VBA Get File Path of Active Workbook as String without a URL

    When I use ThisWorkbook.path I get back a URL (https://...) instead of a file path (C:\...). How do I use VBA to get the local file path? For context, the workbook I'm using is saved in my OneDrive folder.
  4. G

    SaveAs save in right folder

    Hi I got this code: Private Sub GemSom_Click() If Dir(ThisWorkbook.Path & "" & Range("b6").Value & " " & Date, vbDirectory) = "" Then MkDir ThisWorkbook.Path & "" & Range("b6").Value & " " & Date End If 'Dim Path As String 'Dim FileName As String 'FileName = Range("b6").Value & " " & Date...
  5. M

    Open This Workbook.Path

    I'm having problems understanding how to designate a specific file path on this line of code. This works as long as the file is one folder before \old reports..... As soon as the file is moved the code no longer works. I would like to be able to hardcode a folder such as...
  6. D

    VBA to import data in already opened third party software.

    Sub openspcolumn() CreateObject("Shell.Application").Open (ThisWorkbook.Path & "\SP" & "\slendercolumn.col") End Sub ............................................................................................................................................................. This code...
  7. R

    Running code on all files from a folder

    Hello Guys, I would like to run this code on all files from a specific folder. Someone could please help me? Best Regards, Rafael Fernandes Code (from Tommy Miles of Houston, Texas): Sub SplitWorkbook() Dim ws As Worksheet Dim DisplayStatusBar As Boolean DisplayStatusBar =...
  8. J

    How do i use Thisworkbook.path with this VBA

    Hi, i have some code which works fine with a set URL but i want to substitute it to use the workbook path ThisWorkbook.Path & "\MYDB\DATABASE1.mdb" the code below Sub getData1() dat1 = Range("I2").Value MYSQL = "SELECT * FROM `C:\test\MYDB\DATABASE1.mdb`.TABLE1 TABLE1WHERE TABLE1.EDAT="...
  9. syndee

    Anyway to stop Excel from flickering when opening a macro

    Have workbook that does everything I want but flickers when I open it. I have Screen updating. false but still flickers. Maybe it's normal, just thought I'd ask. Private Sub Workbook_Open() Application.ScreenUpdating = False Workbooks.Open (ThisWorkbook.Path & "\Accrual Report.csv")...
  10. ask2tsp

    ThisWorkbook.Path value running Office/365 and onedrive

    T o create files in the folder where the workbook is located Thisworkbook.Path is the preferred choice, but that gives errors with Office/365 and onedrive. In my case Thisworkbook.Path= "https://d.docs.live.net/beccd3471f9cbf60/Documenten/code snippets/Symbol table" local (in my laptop) this...
  11. A

    Refresh Chart in userform

    Hey community, I use userform where users can select workers name and gets details about him. I want to put chart in userform to show workers progress. But it shows only last result. it is not updating when i choose different worker. Any solution for instant update of chart result ?' Private...
  12. B

    Auto Filter of range class failed

    Hello I keep getting an error that I can't figure out why, I have been racking my brain for hours. I keep getting the auto filter of range class failed and all spelling is correct and there shouldn't be any problems. Here is my code. Sub SplitCodeFilterSheet() Dim wswb As StringDim wssh As...
  13. A

    VBA - Customizing Excel file name using named range and attaching to email

    I have figured out how to customize an excel file name and attach it to an email, but cannot seem to get the code to work using a named range in my workbook. I want to use a named range so the file name is automatically adjusted based on information within the workbook. This is the code that...
  14. sharky12345

    Open .txt file

    Can someone show me how I can open the following file through VBA? dt = Format(Now, "dd_mm_yyyy_hh:mm") ThisWorkbook.path & "\Vehicle Maintenance Files\Reports\Vehicle Fleet Status Log " & dt & ".txt"
  15. kelly mort

    File path issue gets tougher

    Hello I have this issue here and I need help : Sub pdfCreate () Dim FolderPath As String FolderPath = ThisWorkbook.Path & "\PDF FILES" ChDir ThisWorkbook.Path & "\PDF FILES" Sheet10.ExportAsFixedFormat Type:=xlTypePDF, Filename:=Sheet10.Range("F4").Text, Quality:=xlQualityStandard, _...
  16. M

    Using excel to create a folder in a sharepoint library

    Hi all - i am working in Excel 2010 and our comnpany are starting to use SharePoint. Within a number of the excel files we use, there is a need to produce a pdf report of one or more of the worksheets. This worked fine when saving using network folders (simple thisworkbook.path method)...
  17. U

    Trying to link data from two programs, getting "Run-time 1004: Method 'Range' of object '_Worksheet' failed"

    Hello, I have a two excel workbooks, one (Workbook A) which is designed with a macro to pull in info from the other (Workbook B). Recently someone made changes to Workbook A that prevent the linking from occurring, but I do not know what they did. The VBA is identical to the an older version of...

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