473,322 Members | 1,314 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Open existing Spreadsheet From Access 2003

4
I would like to open an existing spreadsheet in access and leave it running after the procedure ends. I was able to do this in Access 95-2002. With access 2003 it no longer works. I have tried creating an excel onbect variable and then I use set myobject =GetObject(Path and file name). Then I make the object visible. As soon as the function ends the excel app closes automatically. If I use the object.UserControl=True I get a blank excel app.

Could someone help
Harry
Apr 10 '07 #1
2 1827
Rabbit
12,516 Expert Mod 8TB
You can use this to open a file. However the shell stays open for as long as the document stays open.
Expand|Select|Wrap|Line Numbers
  1. Call Shell("cmd /c " & """" & path & """")
Apr 10 '07 #2
pks00
280 Expert 100+
how about

Expand|Select|Wrap|Line Numbers
  1. application.followhyperlink "c:\mydamnsexyexcelfile.xls"
or perhaps use of ShellExecute, useful to open anything
eg add this lot to a module then call RunYourProgram passing in the name of your excel file, which I dont expect it to be mydamnsexyexcelfile ;)

Expand|Select|Wrap|Line Numbers
  1. Public Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _
  2.   (ByVal hwnd As Long, _
  3.    ByVal lpOperation As String, _
  4.    ByVal lpFile As String, _
  5.    ByVal lpParameters As String, _
  6.    ByVal lpDirectory As String, _
  7.    ByVal nShowCmd As Long) As Long
  8.  
  9.  
  10. Public Sub RunYourProgram(ByVal sFile As String)
  11.   Dim RetVal As Long
  12.   On Error Resume Next
  13.   RetVal = ShellExecute(0, "open", sFile, "", "", 3)
  14. End Sub
  15.  
Apr 10 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

13
by: Allison Bailey | last post by:
Hi Folks, I'm a brand new Python programmer, so please point me in the right direction if this is not the best forum for this question.... I would like to open an existing MS Excel spreadsheet...
55
by: Steve Jorgensen | last post by:
In a recent thread, RKC (correctly, I believe), took issue with my use of multiple parameters in a Property Let procedure to pass dimensional arguments on the basis that, although it works, it's...
4
by: Jenni | last post by:
Hi, A quick question. I have been battling with this code all morning, please help. Here is the code Dim fPath1 As String Dim fPath2 As String fPath1 = "C:\Program Files\Microsoft...
2
by: Anne Sachleben via AccessMonster.com | last post by:
I am using the TransferSpreadsheet function to export a query result to a specific worksheet in an Excel file titled "report". I want the result to be exported to the worksheet titled "facts". ...
1
by: Joe Cletcher | last post by:
It's got to be simple, but there doesn't seem to be an "open" method for opening an existing Excel spreadsheet in a VB.Net. What do I do after the following? Dim myExcel As...
6
by: Syvman | last post by:
Here's what I've got: I'm trying to grab some data out of an Excel spreadsheet and bring it into Access. I'm able to do it, but only if the Excel spreadsheet is not opened by any other users. I...
2
by: Peter S. | last post by:
I have an ASP.NET page that invokes a web control written in C#. What I want to do is (based on the session ID) display a certain spreadsheet that exists on a network drive. I want the webcontrol...
0
by: mix01 | last post by:
Hi, I am trying to get some VBA code working, but am preplex as to why it does not work. I would really appreciate any level of help. Many thanks, Mix01 Version of the program
0
by: Gary Herron | last post by:
Greg Lindstrom wrote: Here's a snippet of code I use to open a spreadsheet (given as a file path name), and compute and return the list of sheets it contains. It connects to an existing...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.