Quantcast
Channel: DIAdem topics
Viewing all articles
Browse latest Browse all 3197

file path for excel file

$
0
0

Hi Everyone,

I am writing and reading data from an Excel file (see code) and it works but I have to specify the path in the script and if I want to change the file I have to change the file path in the code.

I would like to create a window that pops and asks the user to pick the excel file he wants to work with, copy the path and replace

"C:\Users\Public\Documents\National Instruments\DIAdem 2012\Documents\Constant Radius\USED\Test.xlsx" by that path.

I hope someone can give me a hand with this.....

 

Thanks

Leo

 

Dim Excel,a Set Excel = CreateObject("Excel.Application") Excel.Visible = TRUE Call Excel.Workbooks.Open("C:\Users\Public\Documents\National Instruments\DIAdem 2012\Documents\Constant Radius\USED\Test.xlsx") a=Excel.ActiveSheet.Cells(1,1).Value Excel.ActiveSheet.Cells(1,4).Value = RV1(1) Excel.ActiveSheet.Cells(2,4).Value = RV1(2) Excel.ActiveSheet.Cells(3,4).Value = RV1(3) Excel.ActiveSheet.Cells(4,4).Value = RV1(4) Excel.ActiveSheet.Cells(5,4).Value = RV1(5) Excel.ActiveSheet.Cells(6,4).Value = RV1(6) Excel.ActiveSheet.Cells(7,4).Value = RV1(8) Excel.ActiveSheet.Parent.Saved = FALSE Excel.Quit Set Excel = Nothing

 


Viewing all articles
Browse latest Browse all 3197

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>