Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.basic.visual.misc > #1244

Re: Problem automating Excel 2007 under Win7

From GS <gs@somewhere.net>
Newsgroups comp.lang.basic.visual.misc, microsoft.public.vb.general.discussion
Subject Re: Problem automating Excel 2007 under Win7
Date 2012-06-18 09:36 -0400
Organization A noiseless patient Spider
Message-ID <jrnask$e09$1@dont-email.me> (permalink)
References (1 earlier) <kfkst71f6esagh9nnmp2fdb2ammg9530bu@4ax.com> <jrlq60$uqf$1@dont-email.me> <jrlqql$27j$1@dont-email.me> <jrlrf9$5bb$1@dont-email.me> <jrmvt5$kup$1@speranza.aioe.org>

Cross-posted to 2 groups.

Show all headers | View raw


Farnsworth wrote :
> "GS" <gs@somewhere.net> wrote in message news:jrlrf9$5bb$1@dont-email.me...
>> It happens that Henning formulated :
>>> Missing & "\" in App.Path & gsAPP_WKB_UI12?
>>
>> Const gsAPP_WKB_UI12                  As String = "\ui12su.xlam"
>>
>> I did not prepend the backslash to gszAPP_WKB because I use the name 
>> without it various places. The only thing gsAPP_WKB_UI12 does is setup the 
>> UI via its XML component in versions of Excel that use the 'Ribbon'.
>
> Since you mentioned that you have a USB version, use a global variable 
> instead of using App.Path directly. App.Path could have "\" at the end if 
> your app is running from a root folder such as from a network drive dedicated 
> to applications, or USB drives. Example App.Path contents:
>
> C:\Program Files\My App <- No backslash
> E:\ <- USB or network drive, root folder, has backslash
>
> So use code like this:
>
> Public AppPath As String
>
> AppPath = App.Path
> If Right(AppPath, 1) = "\" Then
>     AppPath = Left(AppPath, Len(AppPath) - 1) ' Remove the trailing \, such 
> as in "C:\"
> End If

Interestingly, I do exactly that in app code for the opposite reason, 
and set it up in my 'InitGlobals' proc at startup...

  Public gsAppPath$

  gsAppPath = App.Path
  If Not Right(gsAppPath, 1) = "\" Then gsAppPath = gsAppPath & "\"

The structure I use for storage (regardless of drive/location) is to 
put all my apps under my main folder...

  C:\
    MyMainFolder\
      MyApp\
      MyOtherApp\
      ...and so on

..where the root could be a hard drive on a local machine or removeable 
storage device. Since there's not much call/use to run my apps from a 
network share I don't support that config because my licensing 
methodology is structured to use local installs that validate on the 
server.

What I have in this scenario is a frontloader that validates licensing 
before startup. I was temporarily brain dead when I modified my code to 
unload any COMAddins from my auto-instance, knowing full well an error 
would occur if there weren't any. (Normally, auto-instances have no 
addins or files that normally load from a 'startup' folder. However, 
some developers wrongfully put their COMAddins under HKLM instead of 
HKCU and so these will persist no matter what. This does not happen 
with workbook-based addins!)

-- 
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup!
    comp.lang.basic.visual.misc
    microsoft.public.vb.general.discussion

Back to comp.lang.basic.visual.misc | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Problem automating Excel 2007 under Win7 GS <gs@somewhere.net> - 2012-06-17 15:04 -0400
  Re: Problem automating Excel 2007 under Win7 ralph <nt_consulting64@yahoo.com> - 2012-06-17 16:57 -0500
    Re: Problem automating Excel 2007 under Win7 GS <gs@somewhere.net> - 2012-06-17 19:45 -0400
      Re: Problem automating Excel 2007 under Win7 "Henning" <computer_hero@coldmail.com> - 2012-06-18 01:56 +0200
        Re: Problem automating Excel 2007 under Win7 GS <gs@somewhere.net> - 2012-06-17 20:07 -0400
          Re: Problem automating Excel 2007 under Win7 "Farnsworth" <nospam@nospam.com> - 2012-06-18 06:28 -0400
            Re: Problem automating Excel 2007 under Win7 GS <gs@somewhere.net> - 2012-06-18 09:36 -0400
            Re: Problem automating Excel 2007 under Win7 GS <gs@somewhere.net> - 2012-06-18 12:41 -0400
  Re: Problem automating Excel 2007 under Win7 GS <gs@somewhere.net> - 2012-06-17 20:37 -0400

csiph-web