Hi,
I write VBA codes every now and then and am quite comfortable with it. However, I am failing to do something very very basic and totally perplexed at what am I doing wrong.
I am trying to open a file from a code. I have written a very simple one line Sub for it, which goes like:
Sub SendTradeRequest
Workbooks.Open "C:\Users\Precision Engg Corp\Desktop\Test.xlsx"
End Sub
The workbook as above, does exist. The proof is that when I copy paste the above name in Run command under Start menu, it opens the file. But everytime I run the code from Excel, I get an error message:
-------
Run-time error '1004':
'C:\Users\Precision Engg Corp\Desktop\Test.xlsx' could not be found. Check the spelling, and verify the file location..... and all that jazz.
-------
What am I doing wrong? Can someone help please, it's driving me nuts?
Thanks,
Polo
I write VBA codes every now and then and am quite comfortable with it. However, I am failing to do something very very basic and totally perplexed at what am I doing wrong.
I am trying to open a file from a code. I have written a very simple one line Sub for it, which goes like:
Sub SendTradeRequest
Workbooks.Open "C:\Users\Precision Engg Corp\Desktop\Test.xlsx"
End Sub
The workbook as above, does exist. The proof is that when I copy paste the above name in Run command under Start menu, it opens the file. But everytime I run the code from Excel, I get an error message:
-------
Run-time error '1004':
'C:\Users\Precision Engg Corp\Desktop\Test.xlsx' could not be found. Check the spelling, and verify the file location..... and all that jazz.
-------
What am I doing wrong? Can someone help please, it's driving me nuts?
Thanks,
Polo